##// END OF EJS Templates
fixes #35 hg-app does not respect SCRIPT_NAME
fixes #35 hg-app does not respect SCRIPT_NAME

File last commit:

r506:d5efb835 default
r508:fdb78a14 default
Show More
__init__.py
59 lines | 1.5 KiB | text/x-python | PythonLexer
Implemented locking for task, to prevent for running the same tasks,...
r497 from pylons_app.lib.pidlock import DaemonLock, LockHeld
starting celery branch
r467 from vcs.utils.lazy import LazyProperty
Implemented locking for task, to prevent for running the same tasks,...
r497 from decorator import decorator
starting celery branch
r467 import logging
Implemented password reset(forms/models/ tasks) and mailing tasks....
r474 import os
import sys
import traceback
Implemented locking for task, to prevent for running the same tasks,...
r497 from hashlib import md5
starting celery branch
r467 log = logging.getLogger(__name__)
class ResultWrapper(object):
def __init__(self, task):
self.task = task
@LazyProperty
def result(self):
return self.task
Some fixes to summary, and total rewrite of summary graphs implemented more interactive graph....
r487 def run_task(task, *args, **kwargs):
starting celery branch
r467 try:
Some fixes to summary, and total rewrite of summary graphs implemented more interactive graph....
r487 t = task.delay(*args, **kwargs)
log.info('running task %s', t.task_id)
starting celery branch
r467 return t
Some fixes to summary, and total rewrite of summary graphs implemented more interactive graph....
r487 except Exception, e:
Implemented locking for task, to prevent for running the same tasks,...
r497 print e
Some fixes to summary, and total rewrite of summary graphs implemented more interactive graph....
r487 if e.errno == 111:
log.debug('Unnable to connect. Sync execution')
else:
log.error(traceback.format_exc())
starting celery branch
r467 #pure sync version
Some fixes to summary, and total rewrite of summary graphs implemented more interactive graph....
r487 return ResultWrapper(task(*args, **kwargs))
Implemented locking for task, to prevent for running the same tasks,...
r497
simplified task locking, and fixed some bugs for keyworded arguments
r502 def locked_task(func):
def __wrapper(func, *fargs, **fkwargs):
params = list(fargs)
params.extend(['%s-%s' % ar for ar in fkwargs.items()])
Implemented locking for task, to prevent for running the same tasks,...
r497 lockkey = 'task_%s' % \
simplified task locking, and fixed some bugs for keyworded arguments
r502 md5(str(func.__name__) + '-' + \
'-'.join(map(str, params))).hexdigest()
Implemented locking for task, to prevent for running the same tasks,...
r497 log.info('running task with lockkey %s', lockkey)
try:
l = DaemonLock(lockkey)
fixed lock decorator bug which didn't release the lock after func execution and rewrote the pidlock a little with Ask Solem suggestions!...
r506 func(*fargs, **fkwargs)
Implemented locking for task, to prevent for running the same tasks,...
r497 l.release()
except LockHeld:
log.info('LockHeld')
return 'Task with key %s already running' % lockkey
simplified task locking, and fixed some bugs for keyworded arguments
r502 return decorator(__wrapper, func)
Implemented locking for task, to prevent for running the same tasks,...
r497