Changed cron uploader to better handle concurrent run attmpts
This commit is contained in:
parent
e7d11f2310
commit
6282881c4a
1 changed files with 13 additions and 10 deletions
|
@ -119,11 +119,13 @@ class CronUploader extends Extension
|
||||||
public function onLog(LogEvent $event)
|
public function onLog(LogEvent $event)
|
||||||
{
|
{
|
||||||
global $user_config;
|
global $user_config;
|
||||||
|
|
||||||
|
if (self::$IMPORT_RUNNING) {
|
||||||
$all = $user_config->get_bool(CronUploaderConfig::INCLUDE_ALL_LOGS);
|
$all = $user_config->get_bool(CronUploaderConfig::INCLUDE_ALL_LOGS);
|
||||||
if (self::$IMPORT_RUNNING &&
|
if($event->priority >= $user_config->get_int(CronUploaderConfig::LOG_LEVEL) &&
|
||||||
$event->priority >= $user_config->get_int(CronUploaderConfig::LOG_LEVEL) &&
|
($event->section==self::NAME || $all)) {
|
||||||
($event->section==self::NAME || $all)
|
|
||||||
) {
|
|
||||||
$output = "[" . date('Y-m-d H:i:s') . "] " . ($all ? '[' . $event->section . '] ' : '') . "[" . LOGGING_LEVEL_NAMES[$event->priority] . "] " . $event->message;
|
$output = "[" . date('Y-m-d H:i:s') . "] " . ($all ? '[' . $event->section . '] ' : '') . "[" . LOGGING_LEVEL_NAMES[$event->priority] . "] " . $event->message;
|
||||||
|
|
||||||
echo $output . "\r\n";
|
echo $output . "\r\n";
|
||||||
|
@ -133,6 +135,7 @@ class CronUploader extends Extension
|
||||||
file_put_contents($log_path, $output);
|
file_put_contents($log_path, $output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private function restage_folder(string $folder)
|
private function restage_folder(string $folder)
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue