From: Steinar H. Gunderson Date: Mon, 25 Dec 2006 16:30:41 +0000 (+0100) Subject: Clear cache on rotation. X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=1a9cbb3a4dd482391f3a3d9f36d4f8ab3282fe58 Clear cache on rotation. --- diff --git a/perl/Sesse/pr0n/Rotate.pm b/perl/Sesse/pr0n/Rotate.pm index 0733cec..5a3fe86 100644 --- a/perl/Sesse/pr0n/Rotate.pm +++ b/perl/Sesse/pr0n/Rotate.pm @@ -37,6 +37,9 @@ sub handler { if ($rotval == 90 || $rotval == 270) { my $q = $dbh->do('UPDATE images SET height=width,width=height WHERE id=?', undef, $id) or dberror($r, "Size clear of $id failed: $!"); + $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE event=( SELECT event FROM images WHERE id=? )', + undef, $id) + or dberror($r, "Cache invalidation at $id failed"); } } elsif ($key =~ /^del-(\d+)$/ && $apr->param($key) eq 'on') { my $id = $1;