From a93f161d80f6ec9bd2ca55f6d14e4cdf3df2113f Mon Sep 17 00:00:00 2001 From: "Leigh B. Stoller" Date: Thu, 29 Jan 2009 23:01:57 +0000 Subject: [PATCH] Some fixes to make sure that object are removed from the cache when deleted, as for long running daemons. --- db/Experiment.pm.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/db/Experiment.pm.in b/db/Experiment.pm.in index 212eb7444..07c14e30d 100644 --- a/db/Experiment.pm.in +++ b/db/Experiment.pm.in @@ -744,6 +744,9 @@ sub Delete($;$) DBQueryWarn("DELETE from experiments ". "WHERE eid='$eid' and pid='$pid'"); + # Delete from cache. + delete($experiments{"$exptidx"}); + # # Mark experiment destroyed. This is a backup to End() below. # @@ -781,6 +784,16 @@ sub Delete($;$) return 0; } +# +# Flush from our little cache, as for the expire daemon. +# +sub Flush($) +{ + my ($self) = @_; + + delete($experiments{$self->idx()}); +} + # # Add an input file to the template. The point of this is to reduce # duplication by taking an md5 of the input file, and sharing that -- GitLab