PMCORE-3196 'Unassigned cases' task in cron is not working correctly with 'system_utc_time_zone' enabled

This commit is contained in:
Roly Gutierrez
2021-09-08 17:10:46 -04:00
parent e1be31ad86
commit e7590ceea4
2 changed files with 12 additions and 3 deletions

View File

@@ -1,9 +1,13 @@
<?php
namespace App\Console\Commands;
use Bootstrap;
use Illuminate\Support\Carbon;
use Illuminate\Console\Scheduling\ScheduleRunCommand as BaseCommand;
use Maveriks\WebApplication;
use ProcessMaker\Model\TaskScheduler;
class ScheduleRunCommand extends BaseCommand
{
use AddParametersTrait;
@@ -50,7 +54,7 @@ class ScheduleRunCommand extends BaseCommand
if (!$win) {
$body = str_replace(" -c"," " . $user . " -c", $p->body);
}
$that->schedule->exec($body)->cron($p->expression)->between($starting, $ending)->timezone($timezone)->when(function () use ($p) {
$schedule = $that->schedule->exec($body)->cron($p->expression)->between($starting, $ending)->timezone($timezone)->when(function () use ($p) {
$now = Carbon::now();
$result = false;
$datework = Carbon::createFromFormat('Y-m-d H:i:s', $p->last_update);
@@ -88,7 +92,11 @@ class ScheduleRunCommand extends BaseCommand
return $result;
}
return true;
})->onOneServer();
});
$config = Bootstrap::getSystemConfiguration();
if (intval($config['on_one_server_enable']) === 1) {
$schedule->onOneServer();
}
}
});
parent::handle();

View File

@@ -83,7 +83,8 @@ class System
'report_table_floating_number' => 4,
'report_table_double_number' => 4,
'ext_ajax_timeout' => 600000,
'disable_task_manager_routing_async' => '0'
'disable_task_manager_routing_async' => '0',
'on_one_server_enable' => 0
];
/**