mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-25 22:09:11 -04:00
Wrap album deletes in a batch so that we can handle lots of cascading
deletes in bulk. This lets us avoid the problem where we continually choose and delete album covers which makes deletes really slow. It probably also avoids huge amounts of notification emails (untested). Fixes ticket #1190.
This commit is contained in:
@@ -116,7 +116,16 @@ class Quick_Controller extends Controller {
|
||||
}
|
||||
|
||||
$parent = $item->parent();
|
||||
$item->delete();
|
||||
|
||||
if ($item->is_album()) {
|
||||
// Album delete will trigger deletes for all children. Do this in a batch so that we can be
|
||||
// smart about notifications, album cover updates, etc.
|
||||
batch::start();
|
||||
$item->delete();
|
||||
batch::stop();
|
||||
} else {
|
||||
$item->delete();
|
||||
}
|
||||
message::success($msg);
|
||||
|
||||
$from_id = Input::instance()->get("from_id");
|
||||
|
||||
Reference in New Issue
Block a user