diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-12-02 13:10:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-02 13:10:05 -0500 |
commit | f685318c2aa5d4a54239f7fc444bdaca6ba975bd (patch) | |
tree | 881c6836ff152d46247f90e23e41d0da54f6c552 /synapse/rest/client/register.py | |
parent | Fix Rust lint CI (#14602) (diff) | |
download | synapse-f685318c2aa5d4a54239f7fc444bdaca6ba975bd.tar.xz |
Use ClientRestResource on both the main process and workers. (#14528)
Add logic to ClientRestResource to decide whether to mount servlets or not based on whether the current process is a worker. This is clearer to see what a worker runs than the completely separate / copy & pasted list of servlets being mounted for workers.
Diffstat (limited to 'synapse/rest/client/register.py')
-rw-r--r-- | synapse/rest/client/register.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/rest/client/register.py b/synapse/rest/client/register.py index de810ae3ec..3cb1e7e375 100644 --- a/synapse/rest/client/register.py +++ b/synapse/rest/client/register.py @@ -949,9 +949,10 @@ def _calculate_registration_flows( def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None: - EmailRegisterRequestTokenRestServlet(hs).register(http_server) - MsisdnRegisterRequestTokenRestServlet(hs).register(http_server) - UsernameAvailabilityRestServlet(hs).register(http_server) - RegistrationSubmitTokenServlet(hs).register(http_server) + if hs.config.worker.worker_app is None: + EmailRegisterRequestTokenRestServlet(hs).register(http_server) + MsisdnRegisterRequestTokenRestServlet(hs).register(http_server) + UsernameAvailabilityRestServlet(hs).register(http_server) + RegistrationSubmitTokenServlet(hs).register(http_server) RegistrationTokenValidityRestServlet(hs).register(http_server) RegisterRestServlet(hs).register(http_server) |