Skip to content

Commit

Permalink
Make _setup_periodic_tasks thread-safe
Browse files Browse the repository at this point in the history
(cherry picked from commit 8cae47b)
  • Loading branch information
themylogin authored and bugclerk committed Sep 22, 2024
1 parent 4bd3a23 commit 04b08ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/middlewared/middlewared/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,8 @@ def _setup_periodic_tasks(self):
f"Setting up periodic task {method_name} to run every {method._periodic.interval} seconds"
)

self.loop.call_later(
self.loop.call_soon_threadsafe(
self.loop.call_later,
delay,
functools.partial(
self.__call_periodic_task,
Expand Down

0 comments on commit 04b08ff

Please sign in to comment.