mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 01:33:38 +08:00
PERF: Remove database query when publishing to staff users.
This commit is contained in:
parent
e0aec23844
commit
16f0d1c503
|
@ -32,7 +32,7 @@ module Jobs
|
|||
# push an updated list to the clients
|
||||
store = BackupRestore::BackupStore.create
|
||||
data = ActiveModel::ArraySerializer.new(store.files, each_serializer: BackupFileSerializer).as_json
|
||||
MessageBus.publish("/admin/backups", data, user_ids: User.staff.pluck(:id))
|
||||
MessageBus.publish("/admin/backups", data, group_ids: [Group::AUTO_GROUPS[:staff]])
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -103,7 +103,7 @@ module Jobs
|
|||
MessageBus.publish("/web_hook_events/#{@web_hook.id}", {
|
||||
web_hook_event_id: web_hook_event.id,
|
||||
event_type: @arguments[:event_type]
|
||||
}, user_ids: User.human_users.staff.pluck(:id))
|
||||
}, group_ids: [Group::AUTO_GROUPS[:staff]])
|
||||
end
|
||||
|
||||
def ping_event?(event_type)
|
||||
|
|
Loading…
Reference in New Issue
Block a user