1
0
mirror of https://github.com/mastodon/mastodon.git synced 2024-12-14 15:15:08 +01:00
mastodon/app/workers/regeneration_worker.rb
Eugen Rochko 9014367bd8
Fix background jobs not using locks like they are supposed to ()
Also:

- Fix locks not being removed when jobs go to the dead job queue
- Add UI for managing locks to the Sidekiq dashboard
- Remove unused Sidekiq workers

Fix 
2020-03-31 21:59:03 +02:00

15 lines
301 B
Ruby

# frozen_string_literal: true
class RegenerationWorker
include Sidekiq::Worker
sidekiq_options lock: :until_executed
def perform(account_id, _ = :home)
account = Account.find(account_id)
PrecomputeFeedService.new.call(account)
rescue ActiveRecord::RecordNotFound
true
end
end