mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
queue: Allow sharding user_activity worker.
This follows the existing patterns for the sharded mobile notifications worker.
This commit is contained in:
@@ -31,6 +31,9 @@ normal_queues = [
|
||||
mobile_notification_shards = int(
|
||||
get_config(get_config_file(), "application_server", "mobile_notification_shards", "1")
|
||||
)
|
||||
user_activity_shards = int(
|
||||
get_config(get_config_file(), "application_server", "user_activity_shards", "1")
|
||||
)
|
||||
|
||||
OK = 0
|
||||
WARNING = 1
|
||||
@@ -175,6 +178,8 @@ def check_rabbitmq_queues() -> None:
|
||||
f"missedmessage_mobile_notifications_shard{d}"
|
||||
for d in range(1, mobile_notification_shards + 1)
|
||||
]
|
||||
if user_activity_shards > 1:
|
||||
check_queues += [f"user_activity_shard{d}" for d in range(1, user_activity_shards + 1)]
|
||||
|
||||
queues_to_check = set(check_queues).intersection(set(queues_with_consumers))
|
||||
for queue in queues_to_check:
|
||||
|
@@ -62,6 +62,10 @@ for queue_name, count in consumers.items():
|
||||
target_count = int(
|
||||
get_config(config_file, "application_server", "mobile_notification_shards", "1")
|
||||
)
|
||||
elif queue_name == "user_activity":
|
||||
target_count = int(
|
||||
get_config(config_file, "application_server", "user_activity_shards", "1")
|
||||
)
|
||||
else:
|
||||
target_count = int(
|
||||
get_config(config_file, "application_server", f"{queue_name}_workers", "1")
|
||||
|
Reference in New Issue
Block a user