From bf2dafd1a04ef8050ebf08bb512862a1592998c0 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 20 Dec 2012 13:42:37 +0100 Subject: Tweak Celery Task - Make sure Exceptions are pickleable (not sure if this was not the case but this is the pattern as documented in the celery docs. - Don't create a task_id in the GMG code, but save the one implicitely created by celery. - Don't create a task-id directory per upload. Just store queued uploads in a single directory (this is the most controversial change and might need discussion!!!) Signed-off-by: Sebastian Spaeth --- mediagoblin/processing/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mediagoblin/processing/__init__.py') diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index f3a85940..ae3652cf 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -181,9 +181,10 @@ class BaseProcessingFail(Exception): return u"%s:%s" % ( self.__class__.__module__, self.__class__.__name__) - def __init__(self, **metadata): - self.metadata = metadata or {} - + def __init__(self, *args, **kwargs): + # next line is REQUIRED to have pickable exceptions if you want + # to be able to pass in custom arguments (see celery docs) + Exception.__init__(self, *args, **metadata) class BadMediaFail(BaseProcessingFail): """ -- cgit v1.2.3 From b505952508f717e0d4f59d24c87a54ef42673c3f Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Mon, 19 Aug 2013 12:58:00 -0700 Subject: -update to latest master - have mg generate task_id remove --- mediagoblin/processing/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'mediagoblin/processing/__init__.py') diff --git a/mediagoblin/processing/__init__.py b/mediagoblin/processing/__init__.py index ae3652cf..454eb09b 100644 --- a/mediagoblin/processing/__init__.py +++ b/mediagoblin/processing/__init__.py @@ -181,10 +181,8 @@ class BaseProcessingFail(Exception): return u"%s:%s" % ( self.__class__.__module__, self.__class__.__name__) - def __init__(self, *args, **kwargs): - # next line is REQUIRED to have pickable exceptions if you want - # to be able to pass in custom arguments (see celery docs) - Exception.__init__(self, *args, **metadata) + def __init__(self, **metadata): + self.metadata = metadata or {} class BadMediaFail(BaseProcessingFail): """ -- cgit v1.2.3