Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Partially revert #11675; prevent attempting to create pushers on workers
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Jan 19, 2022
1 parent 7ad7a47 commit d836b37
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions synapse/handlers/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,18 +979,16 @@ async def _register_email_threepid(
if (
self.hs.config.email.email_enable_notifs
and self.hs.config.email.email_notif_for_new_users
and token
):
# Pull the ID of the access token back out of the db
# It would really make more sense for this to be passed
# up when the access token is saved, but that's quite an
# invasive change I'd rather do separately.
if token:
user_tuple = await self.store.get_user_by_access_token(token)
# The token better still exist.
assert user_tuple
token_id = user_tuple.token_id
else:
token_id = None
user_tuple = await self.store.get_user_by_access_token(token)
# The token better still exist.
assert user_tuple
token_id = user_tuple.token_id

await self.pusher_pool.add_pusher(
user_id=user_id,
Expand Down

0 comments on commit d836b37

Please sign in to comment.