Move update_client_ip background job from the main process to the background worker. (#12251)

This commit is contained in:
reivilibre 2022-04-01 13:08:55 +01:00 committed by GitHub
parent 319a805cd3
commit f871222880
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 159 additions and 152 deletions

View file

@ -356,7 +356,7 @@ class UserIpCommand(Command):
access_token: str,
ip: str,
user_agent: str,
device_id: str,
device_id: Optional[str],
last_seen: int,
):
self.user_id = user_id
@ -389,6 +389,12 @@ class UserIpCommand(Command):
)
)
def __repr__(self) -> str:
return (
f"UserIpCommand({self.user_id!r}, .., {self.ip!r}, "
f"{self.user_agent!r}, {self.device_id!r}, {self.last_seen})"
)
class RemoteServerUpCommand(_SimpleCommand):
"""Sent when a worker has detected that a remote server is no longer