Permalink
Browse files

Made the deletion process conceptually match the update process.

  • Loading branch information...
1 parent 1ce8c97 commit 6a7bd17ca88ebd9d77b3a07697677b45ce03f856 @toastdriven toastdriven committed Jan 14, 2010
Showing with 13 additions and 0 deletions.
  1. +13 −0 queued_search/management/commands/process_search_queue.py
@@ -193,11 +193,24 @@ def handle_deletes(self):
Deletes are grouped by model class for maximum batching.
"""
+ deletes = {}
previous_path = None
current_index = None
for obj_identifier in self.actions['delete']:
(object_path, pk) = self.split_obj_identifier(obj_identifier)
+
+ if object_path is None or pk is None:
+ self.log.error("Skipping.")
+ continue
+
+ if object_path not in deletes:
+ deletes[object_path] = []
+
+ deletes[object_path].append(pk)
+
+ # We've got all deletes grouped. Process them.
+ for object_path in deletes:
model_class = self.get_model_class(object_path)
if object_path != previous_path:

0 comments on commit 6a7bd17

Please sign in to comment.