Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,21 +456,21 @@ async def _start_when_reactor_running() -> None:


def start_reactor(
hs: HomeServer,
config: HomeServerConfig,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To document why I made the change to pass in the HomeServerConfig instead of hs to start_reactor(...) (as I was having trouble remembering myself the day after):

start_reactor(...) doesn't really have anything to do with the homeserver itself. This is just concerned with starting the Twisted event-loop that could be driving any application. And ideally, we wouldn't even pass something called HomeServerConfig as this is more just ReactorConfig. Currently just done out of convenience.

) -> None:
"""
Start the reactor.
Start the reactor (Twisted event-loop).

Args:
hs: The homeserver to run.
config: The configuration for the homeserver.
"""
_base.start_reactor(
"synapse-homeserver",
soft_file_limit=hs.config.server.soft_file_limit,
gc_thresholds=hs.config.server.gc_thresholds,
pid_file=hs.config.server.pid_file,
daemonize=hs.config.server.daemonize,
print_pidfile=hs.config.server.print_pidfile,
soft_file_limit=config.server.soft_file_limit,
gc_thresholds=config.server.gc_thresholds,
pid_file=config.server.pid_file,
daemonize=config.server.daemonize,
print_pidfile=config.server.print_pidfile,
logger=logger,
)

Expand All @@ -488,7 +488,7 @@ def main() -> None:
if not hs.config.logging.no_redirect_stdio:
redirect_stdio_to_logs()

start_reactor(hs)
start_reactor(homeserver_config)


if __name__ == "__main__":
Expand Down
Loading