Lower the priority of the populate saved search job. This is so that large numbers of saved searches don't overwhelm the job queue and prevent higher priority jobs from running.
11 lines
262 B
Ruby
11 lines
262 B
Ruby
# A job that updates a user's saved searches when they do a search for
|
|
# `search:all` or `search:<label>`.
|
|
class PopulateSavedSearchJob < ApplicationJob
|
|
queue_as :default
|
|
queue_with_priority 20
|
|
|
|
def perform(query)
|
|
SavedSearch.populate(query)
|
|
end
|
|
end
|