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: $!");
+ or dberror($r, "Size clear of $id failed");
+ $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE (vhost,event)=( SELECT vhost,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;
{
eval {
+ $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE (vhost,event)=( SELECT vhost,event FROM images WHERE id=? )',
+ undef, $id);
$dbh->do('INSERT INTO deleted_images SELECT * FROM images WHERE id=?',
- undef, $id);
+ undef, $id);
+ $dbh->do('DELETE FROM exif_info WHERE image=?',
+ undef, $id);
$dbh->do('DELETE FROM images WHERE id=?',
- undef, $id);
+ undef, $id);
};
if ($@) {
# Some error occurred, rollback and bomb out
}
}
}
+
+ my $event = $apr->param('event');
+ $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?', undef, $r->get_server_name, $event)
+ or dberror($r, "Cache invalidation failed");
Sesse::pr0n::Common::footer($r);