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