Commit 089ebf639fd64bcc671afab35f41ea58f8cc5e51
1 parent
ae0da31c
Exists in
master
and in
19 other branches
Log updates and deletes
Showing
2 changed files
with
28 additions
and
0 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/logging.rb
... | ... | @@ -56,6 +56,30 @@ module Searchkick |
56 | 56 | end |
57 | 57 | end |
58 | 58 | end |
59 | + | |
60 | + def bulk_update(records, *args) | |
61 | + if records.any? | |
62 | + event = { | |
63 | + name: "#{records.first.searchkick_klass.name} Update", | |
64 | + count: records.size | |
65 | + } | |
66 | + ActiveSupport::Notifications.instrument("request.searchkick", event) do | |
67 | + super(records, *args) | |
68 | + end | |
69 | + end | |
70 | + end | |
71 | + | |
72 | + def bulk_delete(records) | |
73 | + if records.any? | |
74 | + event = { | |
75 | + name: "#{records.first.searchkick_klass.name} Delete", | |
76 | + count: records.size | |
77 | + } | |
78 | + ActiveSupport::Notifications.instrument("request.searchkick", event) do | |
79 | + super(records) | |
80 | + end | |
81 | + end | |
82 | + end | |
59 | 83 | end |
60 | 84 | |
61 | 85 | module IndexerWithInstrumentation | ... | ... |