mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
presence: Core last_update_id mechanism without API changes.
This commit has the mechanism for setting the .last_update_id on the backend for UserPresence objects, without introducing any API changes. Therefore this should invisible to clients and able to be deployed safely without impact to users.
This commit is contained in:
committed by
Tim Abbott
parent
b1d50b511c
commit
016880f54d
@@ -574,10 +574,15 @@ def do_change_user_setting(
|
||||
seconds=settings.OFFLINE_THRESHOLD_SECS + 120
|
||||
)
|
||||
|
||||
do_update_user_presence(
|
||||
user_profile,
|
||||
get_client("website"),
|
||||
presence_time,
|
||||
status,
|
||||
force_send_update=True,
|
||||
# do_update_user_presence doesn't allow being run inside another
|
||||
# transaction.atomic block, so we need to use on_commit here to ensure
|
||||
# it gets executed outside of our current transaction.
|
||||
transaction.on_commit(
|
||||
lambda: do_update_user_presence(
|
||||
user_profile,
|
||||
get_client("website"),
|
||||
presence_time,
|
||||
status,
|
||||
force_send_update=True,
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user