Clear cache on rotation.
authorSteinar H. Gunderson <sesse@debian.org>
Mon, 25 Dec 2006 16:30:41 +0000 (17:30 +0100)
committerSteinar H. Gunderson <sesse@debian.org>
Mon, 25 Dec 2006 16:30:41 +0000 (17:30 +0100)
perl/Sesse/pr0n/Rotate.pm

index 0733cecb21f5eed78cbbf36af3f6fca41dfd4398..5a3fe868efc9df2325f35361befcb1eee5efdfbc 100644 (file)
@@ -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;