On Monday, August 8, 2022 at 3:50:26 AM UTC-7 Tom Clerckx wrote:

> Version:
> Version 2.22.5-stable+timestamp.2022.06.04.18.13.51
>
> There is a problem with the calculation of next_run_time in 
> gluon/scheduler.py at line 1024
>
> It calculates:
> steps = secondspassed // task.period + 1
>
> However, there is no check done for task.period being 0
>
> This can cause the following scheduler error:
> ZeroDivisionError: float divmod()
>
> I think it would be better to initialize next_run_time and change the last 
> else condition to "elif task.period".
>

How did you get task.period == 0?

I'm wondering if this is a valid use-case; the scheduler has quite a test 
suite.

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/bb3962dc-6e9f-4d9b-8689-20a7e47cec54n%40googlegroups.com.

Reply via email to