From 6af6bc05bbd3c54ca242cbda0e74c62b023fe629 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 12 Dec 2012 10:13:56 -0600 Subject: [PATCH] We don't need to save entries during processing... also adding comments explaining such --- mediagoblin/media_types/audio/processing.py | 2 -- mediagoblin/media_types/video/processing.py | 3 --- mediagoblin/processing/task.py | 3 +++ 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mediagoblin/media_types/audio/processing.py b/mediagoblin/media_types/audio/processing.py index fada083f..aee843d5 100644 --- a/mediagoblin/media_types/audio/processing.py +++ b/mediagoblin/media_types/audio/processing.py @@ -144,7 +144,5 @@ def process_audio(entry): mgg.queue_store.delete_file(queued_filepath) - entry.save() - # clean up workbench workbench.destroy_self() diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index ce47313f..aa6a25df 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -135,6 +135,3 @@ def process_video(entry): entry.media_files['original'] = original_filepath mgg.queue_store.delete_file(queued_filepath) - - # Save the MediaEntry - entry.save() diff --git a/mediagoblin/processing/task.py b/mediagoblin/processing/task.py index 09abebb5..a8bc0f2f 100644 --- a/mediagoblin/processing/task.py +++ b/mediagoblin/processing/task.py @@ -51,8 +51,11 @@ class ProcessMedia(Task): _log.debug('Processing {0}'.format(entry)) + # run the processing code entry.media_manager['processor'](entry) + # We set the state to processed and save the entry here so there's + # no need to save at the end of the processing stage, probably ;) entry.state = u'processed' entry.save() -- 2.25.1