Commit Graph
10 Commits
Author SHA1 Message Date
Sebastian LawandGitHub f1ac25809c [tasks] Fix behavior when task overruns interval
In a scenario with `tasks.loop(seconds=5)`:

The task takes 30 seconds to run on the first two iterations, and then
is nearly instant for iterations afterward. The behavior should be
that the task runs at:

t = 0  (on time)
t = 30 (late, should've been at t = 5)
t = 60 (late, should've been at t = 10)
t = 60 (late, should've been at t = 15)
t = 60 (late, should've been at t = 20)
t = 60 (late, should've been at t = 25)
... 6 more iterations
t = 60 (on time)
t = 65 (on time)

In a scenario with a loop with explicit times set at UTC 1pm, 2pm, 
3pm, 4pm, and 5pm:

- The task takes 6 hour to run on the first iteration, and then is
  nearly instant for iterations afterward. Assuming the task is started
  at noon, the behavior should be that the task runs at `t = 0` and
  then at `t = 3600` 4 times ("catching up" on the missed iterations
  at 2pm, 3pm, 4pm, and 5pm).

- The task takes 30 days to run on the first iteration, and then is
  nearly instant for iterations afterward. Assuming the task is started
  at noon, the behavior should be that the task runs at `t = 0` and
  then at `t = 43200` 149 times ("catching up" on the missed
  iterations for the past month).

This behavior should be documented in the ext.tasks docs
2022-02-26 01:48:27 -05:00
Sebastian LawandGitHub 19ad64adda [tasks] Fix initial loop execution running prematurely 2022-02-21 20:45:03 -05:00
Sebastian LawandGitHub 3c6281ce33 Set attributes of StickerPack as Optional 2022-02-21 06:25:23 -05:00
Sebastian LawandGitHub 835432d161 Allow enums to be compared 2021-08-24 02:28:39 -04:00
Sebastian LawandGitHub 1d2eaf8526 [commands] reset view when Optional argument encounters parsing error 2021-08-19 19:56:28 -04:00
Sebastian LawandGitHub 07483297ad Fix typo in UserFlags.has_unread_urgent_messages 2021-07-21 02:47:36 -04:00
Sebastian LawandGitHub 124c4a3919 Add Template.url 2021-05-12 06:38:26 -04:00
Sebastian LawandGitHub f5727ff0d0 [tasks] fix regular task loops 2021-05-10 20:25:16 -04:00
Sebastian LawandGitHub 8bc489dba8 [tasks] Add support for explicit time parameter 2021-05-09 23:27:43 -04:00
Sebastian LawandGitHub b82a0dc6fd [docs] remove mentions of bot only usability 2021-05-04 07:21:59 -04:00