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
|
# push an updated list to the clients
|
||||||
store = BackupRestore::BackupStore.create
|
store = BackupRestore::BackupStore.create
|
||||||
data = ActiveModel::ArraySerializer.new(store.files, each_serializer: BackupFileSerializer).as_json
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -103,7 +103,7 @@ module Jobs
|
||||||
MessageBus.publish("/web_hook_events/#{@web_hook.id}", {
|
MessageBus.publish("/web_hook_events/#{@web_hook.id}", {
|
||||||
web_hook_event_id: web_hook_event.id,
|
web_hook_event_id: web_hook_event.id,
|
||||||
event_type: @arguments[:event_type]
|
event_type: @arguments[:event_type]
|
||||||
}, user_ids: User.human_users.staff.pluck(:id))
|
}, group_ids: [Group::AUTO_GROUPS[:staff]])
|
||||||
end
|
end
|
||||||
|
|
||||||
def ping_event?(event_type)
|
def ping_event?(event_type)
|
||||||
|
|
Loading…
Reference in New Issue