From 3ceb2ad025c6289bf36dc936a6ad2fa3d3d19aec Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 19 Jun 2015 13:59:29 +0300 Subject: [PATCH] Call purge from take_job and finish_job --- lib/Gruntmaster/Data.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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} : (); -- 2.39.2