diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2012-02-18 10:01:47 -0600 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2012-02-18 10:01:47 -0600 |
commit | 63352aaf70d97a37b6277fab0f9b957d34dcb9df (patch) | |
tree | acdedffc204d89f1f71f09696270e5719f5e3123 /mediagoblin/processing.py | |
parent | 7f3ec607a34e727324397c2bf240f771b12a0455 (diff) | |
parent | feba5c5287a7cb4c0ed8f5124ad60a8a291770ad (diff) | |
download | mediagoblin-63352aaf70d97a37b6277fab0f9b957d34dcb9df.tar.lz mediagoblin-63352aaf70d97a37b6277fab0f9b957d34dcb9df.tar.xz mediagoblin-63352aaf70d97a37b6277fab0f9b957d34dcb9df.zip |
Merge branch 'master' into sqlmigrate
Conflicts:
mediagoblin/db/sql/models.py
Diffstat (limited to 'mediagoblin/processing.py')
-rw-r--r-- | mediagoblin/processing.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/mediagoblin/processing.py b/mediagoblin/processing.py index cbac8030..9e57380d 100644 --- a/mediagoblin/processing.py +++ b/mediagoblin/processing.py @@ -1,5 +1,5 @@ # GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS. +# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -14,6 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import logging + from celery.task import Task from mediagoblin.db.util import ObjectId @@ -23,6 +25,7 @@ from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ from mediagoblin.media_types import get_media_manager +_log = logging.getLogger(__name__) THUMB_SIZE = 180, 180 MEDIUM_SIZE = 640, 640 @@ -57,12 +60,19 @@ class ProcessMedia(Task): try: #__import__(entry.media_type) manager = get_media_manager(entry.media_type) + _log.debug('Processing {0}'.format(entry)) manager['processor'](entry) except BaseProcessingFail, exc: mark_entry_failed(entry._id, exc) return except ImportError, exc: - mark_entry_failed(entry[u'_id'], exc) + _log.error( + 'Entry {0} failed to process due to an import error: {1}'\ + .format( + entry.title, + exc)) + + mark_entry_failed(entry._id, exc) entry.state = u'processed' entry.save() |