mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
Unify rabbitmq usage to use only one queue.
To work around the issue we're having with queue draining between parallel blocking connections, use the same rabbitmq queue for both activity and presence events, keyed on a 'type' flag in the message itself. (imported from commit 188e8fda1695734e52c5740db2195072cfc81479)
This commit is contained in:
@@ -381,13 +381,14 @@ if settings.USING_RABBITMQ or settings.TEST_SUITE:
|
||||
presence_queue = SimpleQueueClient()
|
||||
|
||||
def update_user_presence(user_profile, client, log_time, status):
|
||||
event={'user_profile_id': user_profile.id,
|
||||
event={'type': 'user_presence',
|
||||
'user_profile_id': user_profile.id,
|
||||
'status': status,
|
||||
'time': datetime_to_timestamp(log_time),
|
||||
'client': client.name}
|
||||
|
||||
if settings.USING_RABBITMQ:
|
||||
presence_queue.json_publish("user_presence", event)
|
||||
presence_queue.json_publish("user_activity", event)
|
||||
elif settings.TEST_SUITE:
|
||||
process_user_presence_event(event)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user