Merge pull request #488 from niphlod/fix/scheduler
avoid multiple cascade paths
This commit is contained in:
@@ -96,7 +96,7 @@ IDENTIFIER = "%s#%s" % (socket.gethostname(),os.getpid())
|
||||
logger = logging.getLogger('web2py.scheduler.%s' % IDENTIFIER)
|
||||
|
||||
from gluon import DAL, Field, IS_NOT_EMPTY, IS_IN_SET, IS_NOT_IN_DB
|
||||
from gluon import IS_INT_IN_RANGE, IS_DATETIME
|
||||
from gluon import IS_INT_IN_RANGE, IS_DATETIME, IS_IN_DB
|
||||
from gluon.utils import web2py_uuid
|
||||
from gluon.storage import Storage
|
||||
|
||||
@@ -671,7 +671,10 @@ class Scheduler(MetaScheduler):
|
||||
db.define_table(
|
||||
'scheduler_task_deps',
|
||||
Field('job_name', default='job_0'),
|
||||
Field('task_parent', 'reference scheduler_task'),
|
||||
Field('task_parent', 'integer',
|
||||
requires=IS_IN_DB(db, 'scheduler_task.id',
|
||||
'%(task_name)s')
|
||||
),
|
||||
Field('task_child', 'reference scheduler_task'),
|
||||
Field('can_visit', 'boolean', default=False),
|
||||
migrate=self.__get_migrate('scheduler_task_deps', migrate)
|
||||
@@ -1311,7 +1314,7 @@ class Scheduler(MetaScheduler):
|
||||
"""
|
||||
from gluon.dal import Query
|
||||
sr, st = self.db.scheduler_run, self.db.scheduler_task
|
||||
if isinstance(ref, int):
|
||||
if isinstance(ref, (int, long)):
|
||||
q = st.id == ref
|
||||
elif isinstance(ref, str):
|
||||
q = st.uuid == ref
|
||||
@@ -1362,7 +1365,7 @@ class Scheduler(MetaScheduler):
|
||||
Experimental
|
||||
"""
|
||||
st, sw = self.db.scheduler_task, self.db.scheduler_worker
|
||||
if isinstance(ref, int):
|
||||
if isinstance(ref, (int, long)):
|
||||
q = st.id == ref
|
||||
elif isinstance(ref, str):
|
||||
q = st.uuid == ref
|
||||
|
||||
Reference in New Issue
Block a user