Mercurial > kallithea
comparison rhodecode/lib/celerylib/__init__.py @ 1930:a69573cfcb00 beta
cleanup task session only if celery is on
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 20 Jan 2012 08:14:32 +0200 |
parents | cd8a7e3698bc |
children | a76e9bacbedc |
comparison
equal
deleted
inserted
replaced
1929:cd8a7e3698bc | 1930:a69573cfcb00 |
---|---|
120 def __wrapper(func, *fargs, **fkwargs): | 120 def __wrapper(func, *fargs, **fkwargs): |
121 try: | 121 try: |
122 ret = func(*fargs, **fkwargs) | 122 ret = func(*fargs, **fkwargs) |
123 return ret | 123 return ret |
124 finally: | 124 finally: |
125 meta.Session.remove() | 125 if CELERY_ON: |
126 meta.Session.remove() | |
126 | 127 |
127 return decorator(__wrapper, func) | 128 return decorator(__wrapper, func) |