From 8ec87dc3fddc70c000040e4983df923814de65cc Mon Sep 17 00:00:00 2001 From: Elrond Date: Mon, 8 Apr 2013 16:12:32 +0200 Subject: [PATCH] Implement queue dir delete for proc_state.delete_queue_file Implement queue dir deleting in the proc_state.delete_queue_file helper function. --- mediagoblin/processing/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index 02462567..a1fd3fb7 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -111,8 +111,13 @@ class ProcessingState(object): self.entry.media_files[keyname] = target_filepath def delete_queue_file(self): + # Remove queued media file from storage and database. + # queued_filepath is in the task_id directory which should + # be removed too, but fail if the directory is not empty to be on + # the super-safe side. queued_filepath = self.entry.queued_media_file - mgg.queue_store.delete_file(queued_filepath) + mgg.queue_store.delete_file(queued_filepath) # rm file + mgg.queue_store.delete_dir(queued_filepath[:-1]) # rm dir self.entry.queued_media_file = [] -- 2.25.1