]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/WebDAV.pm
Fix another deadlock-when-many-people-upload bug, like the one we fixed in r14
[pr0n] / perl / Sesse / pr0n / WebDAV.pm
index f428a4f55fcb1889f7213d65e93508c5339411be..c38e7b2f159a1888822dc3d3d230b5011bdf7056 100644 (file)
@@ -468,7 +468,7 @@ EOF
                                        
                                $dbh->do('INSERT INTO images (id,vhost,event,uploadedby,takenby,filename) VALUES (?,?,?,?,?,?)',
                                        undef, $newid, $r->get_server_name, $event, $user, $takenby, $filename);
-                               $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
+                               $dbh->do('UPDATE last_picture_cache SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
                                        undef, $r->get_server_name, $event);
 
                                # Now save the file to disk
@@ -493,7 +493,7 @@ EOF
                                if ($filename !~ /^\.(_|DS_Store)/) {
                                        # FIXME: Ideally we'd want to ensure cache of -1x-1 here as well (for NEFs), but that would
                                        # preclude mipmapping in its current form.
-                                       Sesse::pr0n::Common::ensure_cached($r, $filename, $newid, undef, undef, 1, 80, 64, 320, 256);
+                                       Sesse::pr0n::Common::ensure_cached($r, $filename, $newid, undef, undef, "nobox", 80, 64, 320, 256);
                                }
                                
                                # OK, we got this far, commit
@@ -606,7 +606,7 @@ EOF
                        eval {
                                $dbh->do('INSERT INTO images (id,vhost,event,uploadedby,takenby,filename) VALUES (?,?,?,?,?,?)',
                                        undef, $newid, $r->get_server_name, $event, $user, $takenby, $filename);
-                               $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
+                               $dbh->do('UPDATE last_picture_cache SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
                                        undef, $r->get_server_name, $event);
 
                                # Now save the file to disk
@@ -708,7 +708,7 @@ EOF
                $dbh->do('DELETE FROM images WHERE vhost=? AND event=? AND filename=?',
                        undef, $r->get_server_name, $event, $filename)
                        or dberror($r, "Couldn't remove file");
-               $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
+               $dbh->do('UPDATE last_picture_cache SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
                        undef, $r->get_server_name, $event)
                        or dberror($r, "Couldn't invalidate cache");
                $r->status(200);