Open jeffblake opened 1 year ago
As another data point with the same use-case, I've added a 'monkey-patch' in our codebase in order to shift certain BulkReindexJob
s into a different queue based on their job arguments using the before_enqueue
hook. This was necessary to prevent BulkReindexJob
s from some very long running full reindexes from blocking other calls to reindex since they share the same queue otherwise.
It would be great if we could pass an argument to the relation indexer
reindex
to specify a custom job class instead of the defaultSearchkick::BulkReindexJob
.Use case:
We could have a few subclasses of
Searchkick::BulkReindexJob
and easily change some options such as thequeue_as
queue. For example I have a rake task to reindex all models, but with millions of rows I've decided to set up a separate Sidekiq process that only pulls jobs from a specific queue, to better control load and performance on the overall app. This works fine, but if I also need to use the relationreindex
method in normal code operations, then I can't change the queue and it means I have to have that extra process always spun up (and paying for - I'm on Heroku).Right now I have this in my initializer:
With this feature I could have separate classes and change the queue, etc.