From 35e8aefa9fb061d78f1f47951a0e520e872c6cf7 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 25 Dec 2006 17:27:12 +0100 Subject: [PATCH 1/1] Invalidate the cache on adding and deleting images. --- perl/Sesse/pr0n/WebDAV.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/perl/Sesse/pr0n/WebDAV.pm b/perl/Sesse/pr0n/WebDAV.pm index 08f4c7b..ee0280d 100644 --- a/perl/Sesse/pr0n/WebDAV.pm +++ b/perl/Sesse/pr0n/WebDAV.pm @@ -466,6 +466,8 @@ EOF $dbh->do('INSERT INTO images (id,event,uploadedby,takenby,filename) VALUES (?,?,?,?,?);', undef, $newid, $event, $user, $takenby, $filename); + $dbh->do('UPDATE images SET last_update=CURRENT_TIMESTAMP WHERE event=?', + undef, $event); # Now save the file to disk $fname = Sesse::pr0n::Common::get_disk_location($r, $newid); @@ -578,6 +580,9 @@ EOF $dbh->do('DELETE FROM images WHERE event=? AND filename=?;', undef, $event, $filename) or dberror($r, "Couldn't remove file"); + $dbh->do('UPDATE images SET last_update=CURRENT_TIMESTAMP WHERE event=?', + undef, $event) + or dberror($r, "Couldn't invalidate cache"); $r->status(200); $r->print("OK"); -- 2.39.2