Skip to content

Commit

Permalink
Added Param till
Browse files Browse the repository at this point in the history
  • Loading branch information
arkhan19 committed Jun 21, 2018
1 parent 677a3cd commit 0e526fc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions schedule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,12 @@ def run(self):
logger.info('Running job %s', self)
ret = self.job_func()
self.last_run = datetime.datetime.now()
while self.counter is self.till:
cancel_job(self)
return ret
self._schedule_next_run()
if self.counter is self.till:
cancel_job()
else:
self._schedule_next_run()
return ret


def _schedule_next_run(self):
"""
Compute the instant when this job should run next.
Expand Down

0 comments on commit 0e526fc

Please sign in to comment.