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:
Bharat Mediratta
2010-07-10 18:25:23 -07:00
parent b7cd2f73c5
commit b20f9123dc
2 changed files with 37 additions and 7 deletions

View File

@@ -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");