X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FWebDAV.pm;h=cfaa0ec097da601d0982883b95d0ce8b2bac0425;hp=08f4c7ba57ca34b7e5eb53b201acc8a8c8ce5aa9;hb=25522869d2a8d6b61274e6324be81dab8e429ea1;hpb=1b419e82260d4c5135c1f6a202e2dccd9cfbde43 diff --git a/perl/Sesse/pr0n/WebDAV.pm b/perl/Sesse/pr0n/WebDAV.pm index 08f4c7b..cfaa0ec 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 events SET last_update=CURRENT_TIMESTAMP WHERE id=?', + 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 events SET last_update=CURRENT_TIMESTAMP WHERE id=?', + undef, $event) + or dberror($r, "Couldn't invalidate cache"); $r->status(200); $r->print("OK");