provide Agent.scheduleJobsFromConfig() as part of the start-up procedure; work in progress: filesystem crawler
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1862 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
b9ba07ad95
commit
77e035efbd
2 changed files with 7 additions and 1 deletions
|
@ -72,4 +72,7 @@ class Agent(object):
|
|||
job.successors.append(transporter.jobFactory(transporter))
|
||||
job.repeat = info.repeat or 0
|
||||
self.scheduler.schedule(job, info.starttime or int(time()))
|
||||
# TODO: remove job from config
|
||||
# TODO: put repeating info in config
|
||||
# TODO: remember last run for repeating job
|
||||
|
||||
|
|
|
@ -72,11 +72,14 @@ class Job(object):
|
|||
# TODO: logging
|
||||
|
||||
def finishRun(self, result):
|
||||
# run successors
|
||||
for job in self.successors:
|
||||
job.params['result'] = result
|
||||
job.run(**job.params)
|
||||
# TODO: remove from queue
|
||||
# remove from queue
|
||||
del self.scheduler.queue[self.startTime]
|
||||
# TODO: logging
|
||||
# reschedule if necessary
|
||||
if self.repeat:
|
||||
self.reschedule(int(time() + self.repeat))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue