Our tasks are added using scheduler.queue_task(...) function. By default, we set the period to 0 Later on we added to the defaults : prevent_drift = True
It's this last change that triggered the observed error. On Friday, August 19, 2022 at 12:49:05 PM UTC+2 snide...@gmail.com wrote: > 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/26297db5-d87a-4810-bcaf-bb8711edbf0dn%40googlegroups.com.