mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Display errors and OK message in webcron result page
This commit is contained in:
parent
e8c03318e4
commit
4ebaa6b0cb
5 changed files with 34 additions and 1 deletions
|
|
@ -33,6 +33,7 @@ else
|
|||
}
|
||||
|
||||
// Get queue configuration set by the administrator.
|
||||
$display_errors = config('queue.display_errors') === false ? false : true;
|
||||
$timeout = (config('queue.interval') ?? 1) * 60;
|
||||
$process_count = config('queue.process_count') ?? 1;
|
||||
|
||||
|
|
@ -41,6 +42,10 @@ if (PHP_SAPI !== 'cli')
|
|||
{
|
||||
ignore_user_abort(true);
|
||||
set_time_limit(max(60, $timeout));
|
||||
if ($display_errors)
|
||||
{
|
||||
ini_set('display_errors', true);
|
||||
}
|
||||
if (Rhymix\Framework\Session::checkStart())
|
||||
{
|
||||
Rhymix\Framework\Session::close();
|
||||
|
|
@ -93,3 +98,9 @@ else
|
|||
{
|
||||
Rhymix\Framework\Queue::process($timeout);
|
||||
}
|
||||
|
||||
// If called over the network, display a simple OK message to indicate success.
|
||||
if (PHP_SAPI !== 'cli')
|
||||
{
|
||||
echo "OK\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ class Queue extends Base
|
|||
$driver_config[$conf_name] = $conf_value === '' ? null : $conf_value;
|
||||
}
|
||||
|
||||
// Validate error display setting.
|
||||
$display_errors = Context::get('webcron_display_errors') === 'Y' ? true : false;
|
||||
|
||||
// Validate the interval.
|
||||
$interval = intval($vars->queue_interval ?? 1);
|
||||
if ($interval < 1 || $interval > 10)
|
||||
|
|
@ -116,10 +119,10 @@ class Queue extends Base
|
|||
throw new Exception('msg_queue_driver_not_usable');
|
||||
}
|
||||
|
||||
|
||||
// Save system config.
|
||||
Config::set("queue.enabled", $enabled);
|
||||
Config::set("queue.driver", $driver);
|
||||
Config::set("queue.display_errors", $display_errors);
|
||||
Config::set("queue.interval", $interval);
|
||||
Config::set("queue.process_count", $process_count);
|
||||
Config::set("queue.key", $key);
|
||||
|
|
|
|||
|
|
@ -288,6 +288,8 @@ $lang->cmd_queue_enabled = 'Use Task Queue';
|
|||
$lang->cmd_queue_enabled_help = 'The task queue will stop accepting new tasks if you uncheck the above.';
|
||||
$lang->cmd_queue_driver = 'Queue Driver';
|
||||
$lang->cmd_queue_driver_help = 'Select the driver for the task queue that suits your hosting environment and website needs.<br>Some drivers such as Redis will need the corresponding program to be installed on the server.';
|
||||
$lang->cmd_queue_webcron_display_errors = 'Display Webcron Errors';
|
||||
$lang->cmd_queue_webcron_display_errors_help = 'Show webcron errors to help with debugging, if you have difficulty accessing server error logs.';
|
||||
$lang->cmd_queue_interval = 'Calling Interval';
|
||||
$lang->cmd_queue_interval_help = 'Use a scheduler such as crontab or systemd timer to call the script on a set interval.<br>All tasks are processed as soon as possible regardless of the interval, but a short interval means quick recovery from any error.<br>For web-based cron, this should not exceed the max_execution_time setting in php.ini.<br>The max_execution_time on this server is %d seconds.';
|
||||
$lang->cmd_queue_process_count = 'Process Count';
|
||||
|
|
|
|||
|
|
@ -284,6 +284,8 @@ $lang->cmd_queue_enabled = '비동기 작업 사용';
|
|||
$lang->cmd_queue_enabled_help = '체크를 해제하면 더이상 작업을 접수하지 않습니다.';
|
||||
$lang->cmd_queue_driver = '비동기 드라이버';
|
||||
$lang->cmd_queue_driver_help = '비동기 작업을 관리할 방법을 설정합니다. 호스팅 환경과 사이트의 필요에 맞추어 선택하세요.<br>Redis 등 일부 드라이버는 서버에 해당 기능이 설치되어 있어야 사용할 수 있습니다.';
|
||||
$lang->cmd_queue_webcron_display_errors = '웹크론 오류 표시';
|
||||
$lang->cmd_queue_webcron_display_errors_help = '에러 로그를 확인하기 어려운 서버 환경인 경우, 웹크론 에러를 화면에 표시하여 문제 파악을 돕습니다.';
|
||||
$lang->cmd_queue_interval = '호출 간격';
|
||||
$lang->cmd_queue_interval_help = 'crontab, systemd timer, 웹크론 등을 사용하여 일정한 주기로 스크립트를 호출해 주십시오.<br>모든 비동기 작업은 호출 간격과 무관하게 실시간으로 처리되나, 호출 간격이 짧으면 장애 발생시 신속하게 복구됩니다.<br>웹크론 사용시에는 php.ini의 실행 시간 제한을 초과하지 않는 것이 좋습니다.<br>이 서버의 max_execution_time은 %d초로 설정되어 있습니다.';
|
||||
$lang->cmd_queue_process_count = '프로세스 갯수';
|
||||
|
|
|
|||
|
|
@ -167,6 +167,21 @@ systemctl enable rhymix-queue.timer</code></pre>
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->cmd_queue_webcron_display_errors}</label>
|
||||
<div class="x_controls">
|
||||
<label class="x_inline">
|
||||
<input type="radio" name="webcron_display_errors" value="Y" checked="checked"|cond="config('queue.display_errors') !== false" />
|
||||
{$lang->cmd_yes}
|
||||
</label>
|
||||
<label class="x_inline">
|
||||
<input type="radio" name="webcron_display_errors" value="N" checked="checked"|cond="config('queue.display_errors') === false" />
|
||||
{$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->cmd_queue_webcron_display_errors_help}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="queue_interval">{$lang->cmd_queue_interval}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue