Merge lp:~nursix.org/web2py/patches into lp:~mdipierro/web2py/devel

Proposed by nursix
Status: Needs review
Proposed branch: lp:~nursix.org/web2py/patches
Merge into: lp:~mdipierro/web2py/devel
Diff against target: 0 lines
To merge this branch: bzr merge lp:~nursix.org/web2py/patches
Reviewer Review Type Date Requested Status
Massimo Pending
Review via email: mp+75235@code.launchpad.net

Description of the change

Patch for scheduler to let repeats=0 really mean unlimited repeats.

To post a comment you must log in.
Revision history for this message
Rb (rbspgm01) wrote :

Wow, this email sure went astray. How/why did *I* receive this? I
participated on the web2py forum a couple of years ago - and not since
then. Weird.

---
rb

On Tue, 2011-09-13 at 18:03 +0000, nursix wrote:
> nursix has proposed merging lp:~nursix.org/web2py/patches into lp:~mdipierro/web2py/devel.
>
> Requested reviews:
> Massimo (mdipierro)
>
> For more details, see:
> https://code.launchpad.net/~nursix.org/web2py/patches/+merge/75235
>
> Patch for scheduler to let repeats=0 really mean unlimited repeats.
> differences between files attachment (review-diff.txt)
> === modified file 'gluon/scheduler.py'
> --- gluon/scheduler.py 2011-09-12 02:25:00 +0000
> +++ gluon/scheduler.py 2011-09-13 18:03:25 +0000
> @@ -368,7 +368,7 @@
> try:
> logging.debug(' grabbing all queued tasks')
> all_available = db(ts.status.belongs((QUEUED,RUNNING)))\
> - (ts.times_run<ts.repeats)\
> + ((ts.times_run<ts.repeats) | (ts.repeats == 0))\
> (ts.start_time<=now)\
> (ts.stop_time>now)\
> (ts.next_run_time<=now)\
> @@ -394,7 +394,7 @@
> return None
> next_run_time = task.last_run_time + datetime.timedelta(seconds=task.period)
> times_run = task.times_run + 1
> - if times_run < task.repeats:
> + if times_run < task.repeats or task.repeats == 0:
> run_again = True
> else:
> run_again = False
> @@ -409,7 +409,7 @@
> db.commit()
> break
> except:
> - db.rollback
> + db.rollback()
> logging.info('new task %(id)s "%(task_name)s" %(application_name)s.%(function_name)s' % task)
> return Task(
> app = task.application_name,
>

Revision history for this message
Fran Boon (flavour) wrote :

rb: You can unsubscribe from this page:
https://code.launchpad.net/~mdipierro/web2py/devel

lp:~nursix.org/web2py/patches updated
3764. By nursix

Merge trunk.

3765. By nursix

Merge trunk.

3766. By nursix

Merge trunk.

3767. By nursix

Merge trunk.

3768. By nursix

Merge trunk.

3769. By nursix

Merge trunk.

3770. By nursix

Merge trunk.

3771. By Dominic K&#246;nig <email address hidden>

Merge trunk.

3772. By Dominic K&#246;nig <email address hidden>

Merge trunk.

3773. By nursix

Merge trunk.

3774. By nursix

Merge trunk.

Unmerged revisions

3774. By nursix

Merge trunk.

3773. By nursix

Merge trunk.

3772. By Dominic K&#246;nig <email address hidden>

Merge trunk.

3771. By Dominic K&#246;nig <email address hidden>

Merge trunk.

3770. By nursix

Merge trunk.

3769. By nursix

Merge trunk.

3768. By nursix

Merge trunk.

3767. By nursix

Merge trunk.

3766. By nursix

Merge trunk.

3765. By nursix

Merge trunk.

Preview Diff

Empty