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},
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} : ();