From: Marius Gavrilescu Date: Fri, 19 Jun 2015 10:59:29 +0000 (+0300) Subject: Call purge from take_job and finish_job X-Git-Tag: 5999.000_014~10 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=3ceb2ad025c6289bf36dc936a6ad2fa3d3d19aec;p=gruntmaster-data.git Call purge from take_job and finish_job --- diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index 3b634ca..2468d03 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -252,12 +252,17 @@ sub rerun_job { sub take_job { my ($daemon) = @_; my $id = _query(take_job_sth => $daemon)->list; - return $id ? db->select(jobs => '*', {id => $id})->hash : undef; + return unless $id; + purge '/log/'; + purge "/log/$id"; + db->select(jobs => '*', {id => $id})->hash } sub finish_job { my ($job, $private, %args) = @_; db->update(jobs => \%args, {id => $job->{id}}); + purge '/log/'; + purge '/log/' . $job->{id}; return if $private; my $status = { problem => $job->{problem}, @@ -268,6 +273,7 @@ sub finish_job { eval { db->insert(problem_status => $status) } or db->update(problem_status => $status, {owner => $job->{owner}, problem => $job->{problem}}); + purge '/us/' . $job->{owner}; } my @PURGE_HOSTS = exists $ENV{PURGE_HOSTS} ? split ' ', $ENV{PURGE_HOSTS} : ();