diff options
author | Mathieu Velten <mathieuv@matrix.org> | 2023-08-23 13:37:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-23 13:37:51 +0200 |
commit | 873971a8b9b4cbbc141df570e76a02c7b4b9b9c0 (patch) | |
tree | 665bf300daabae67631965be93b9c4b66cdea5b9 /synapse/util | |
parent | Add tests for restoring the presence state after a restart. (#16151) (diff) | |
download | synapse-873971a8b9b4cbbc141df570e76a02c7b4b9b9c0.tar.xz |
Task scheduler: mark task as active if we are scheduling ASAP (#16165)
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/task_scheduler.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/util/task_scheduler.py b/synapse/util/task_scheduler.py index 773a8327f6..4aea64b338 100644 --- a/synapse/util/task_scheduler.py +++ b/synapse/util/task_scheduler.py @@ -154,13 +154,15 @@ class TaskScheduler: f"No function associated with action {action} of the scheduled task" ) + status = TaskStatus.SCHEDULED if timestamp is None or timestamp < self._clock.time_msec(): timestamp = self._clock.time_msec() + status = TaskStatus.ACTIVE task = ScheduledTask( random_string(16), action, - TaskStatus.SCHEDULED, + status, timestamp, resource_id, params, |