synchronize_featured_collection_worker.rb 468 B

123456789101112131415
  1. # frozen_string_literal: true
  2. class ActivityPub::SynchronizeFeaturedCollectionWorker
  3. include Sidekiq::Worker
  4. sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.day.to_i
  5. def perform(account_id, options = {})
  6. options = { note: true, hashtag: false }.deep_merge(options.deep_symbolize_keys)
  7. ActivityPub::FetchFeaturedCollectionService.new.call(Account.find(account_id), **options)
  8. rescue ActiveRecord::RecordNotFound
  9. true
  10. end
  11. end