|
|
|
@ -1101,7 +1101,7 @@ sub keep_running |
|
|
|
|
sub run_jobs |
|
|
|
|
{ |
|
|
|
|
my ($anvil, $startup) = @_; |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { startup => $startup }}); |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { startup => $startup }}); |
|
|
|
|
|
|
|
|
|
# This will be set to 1 if any jobs are not complete, preventing a restart of the daemon if it's |
|
|
|
|
# changed on disk. |
|
|
|
@ -1112,9 +1112,9 @@ sub run_jobs |
|
|
|
|
|
|
|
|
|
# Get a list of pending or incomplete jobs. |
|
|
|
|
my $ended_within = $startup ? 1 : 300; |
|
|
|
|
my $return = $anvil->Database->get_jobs({debug => 3, ended_within => $ended_within}); |
|
|
|
|
my $return = $anvil->Database->get_jobs({ended_within => $ended_within}); |
|
|
|
|
my $count = @{$return}; |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { |
|
|
|
|
ended_within => $ended_within, |
|
|
|
|
'return' => $return, |
|
|
|
|
count => $count, |
|
|
|
@ -1134,7 +1134,7 @@ sub run_jobs |
|
|
|
|
my $job_status = $hash_ref->{job_status}; |
|
|
|
|
my $started_seconds_ago = $job_picked_up_at ? (time - $job_picked_up_at) : 0; |
|
|
|
|
my $updated_seconds_ago = $job_updated ? (time - $job_updated) : 0; |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { |
|
|
|
|
job_uuid => $job_uuid, |
|
|
|
|
job_command => $job_command, |
|
|
|
|
job_data => $job_data, |
|
|
|
@ -1151,7 +1151,7 @@ sub run_jobs |
|
|
|
|
}}); |
|
|
|
|
|
|
|
|
|
# If this is a start-up call, only start jobs whose status is 'anvil_startup'. |
|
|
|
|
if (($startup) && ($say_status ne "anvil_startup")) |
|
|
|
|
if (($startup) && ($job_status ne "anvil_startup")) |
|
|
|
|
{ |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0639", variables => { |
|
|
|
|
job_uuid => $job_uuid, |
|
|
|
@ -1163,7 +1163,7 @@ sub run_jobs |
|
|
|
|
if ($job_progress ne "100") |
|
|
|
|
{ |
|
|
|
|
$anvil->data->{sys}{jobs_running} = 1; |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "sys::jobs_running" => $anvil->data->{sys}{jobs_running} }}); |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "sys::jobs_running" => $anvil->data->{sys}{jobs_running} }}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# See if the job was picked up by a now-dead instance. |
|
|
|
|