Marcin Kuzminski avatar Marcin Kuzminski committed edfff9f Merge

merge with beta

Comments (0)

Files changed (5)

docs/changelog.rst

 - fixed __future__ import error on rcextensions
 - made simplejson required lib for speedup on JSON encoding
 - fixes #449 bad regex could get more than revisions from parsing history
+- don't clear DB session when CELERY_EAGER is turned ON
 
 1.3.5 (**2012-05-10**)
 ----------------------

rhodecode/__init__.py

 }
 
 CELERY_ON = False
+CELERY_EAGER = False
 
 # link to config for pylons
 CONFIG = {}

rhodecode/config/environment.py

 
     # store some globals into rhodecode
     rhodecode.CELERY_ON = str2bool(config['app_conf'].get('use_celery'))
+    rhodecode.CELERY_EAGER = str2bool(config['app_conf'].get('celery.always.eager'))
 
     config['routes.map'] = make_map(config)
     config['pylons.app_globals'] = app_globals.Globals(config)

rhodecode/lib/celerylib/__init__.py

 from decorator import decorator
 
 from rhodecode.lib.vcs.utils.lazy import LazyProperty
-from rhodecode import CELERY_ON
+from rhodecode import CELERY_ON, CELERY_EAGER
 from rhodecode.lib.utils2 import str2bool, safe_str
 from rhodecode.lib.pidlock import DaemonLock, LockHeld
 from rhodecode.model import init_model
             ret = func(*fargs, **fkwargs)
             return ret
         finally:
-            if CELERY_ON:
+            if CELERY_ON and CELERY_EAGER is False:
                 meta.Session.remove()
 
     return decorator(__wrapper, func)

rhodecode/lib/celerylib/tasks.py

 
 from rhodecode.lib.vcs import get_backend
 
-from rhodecode import CELERY_ON
+from rhodecode import CELERY_ON, CELERY_EAGER
 from rhodecode.lib.utils2 import safe_str
 from rhodecode.lib.celerylib import run_task, locked_task, dbsession, \
     str2bool, __get_lockkey, LockHeld, DaemonLock, get_session
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.