-
Notifications
You must be signed in to change notification settings - Fork 396
Start background tasks after we fork the process (daemonize) #18886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
38b67ca
e39a219
313da3e
ee29030
2f235e3
99b99c2
11c39c5
ed42696
74cd02d
02bb9b4
2ab99d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Start background tasks after we fork the process (daemonize). | ||
MadLittleMods marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -366,12 +366,6 @@ def setup(self) -> None: | |||||||||||||||||||||||
self.datastores = Databases(self.DATASTORE_CLASS, self) | ||||||||||||||||||||||||
logger.info("Finished setting up.") | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
# Register background tasks required by this server. This must be done | ||||||||||||||||||||||||
# somewhat manually due to the background tasks not being registered | ||||||||||||||||||||||||
# unless handlers are instantiated. | ||||||||||||||||||||||||
if self.config.worker.run_background_tasks: | ||||||||||||||||||||||||
self.setup_background_tasks() | ||||||||||||||||||||||||
Comment on lines
-369
to
-373
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In terms of where we moved this code from and to: Relevant starting point is here: synapse/synapse/app/homeserver.py Lines 407 to 417 in b2997a8
The main thing to see here is Previously, we started the background tasks in the Now we start the background tasks in |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
def __del__(self) -> None: | ||||||||||||||||||||||||
""" | ||||||||||||||||||||||||
Called when an the homeserver is garbage collected. | ||||||||||||||||||||||||
|
@@ -410,7 +404,7 @@ def start_listening(self) -> None: # noqa: B027 (no-op by design) | |||||||||||||||||||||||
appropriate listeners. | ||||||||||||||||||||||||
""" | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
def setup_background_tasks(self) -> None: | ||||||||||||||||||||||||
def start_background_tasks(self) -> None: | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a rename to align with it's new home in |
||||||||||||||||||||||||
""" | ||||||||||||||||||||||||
Some handlers have side effects on instantiation (like registering | ||||||||||||||||||||||||
background updates). This function causes them to be fetched, and | ||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.