Skip to content

Commit

Permalink
Bump version to 5.2 LTS (#39)
Browse files Browse the repository at this point in the history
* Bump version to 5.2 LTS

* Revert "Fix ProcessReferencesWorker error for tasks before update"

This reverts commit 75c0e51.

* Fix test

* Add sidekiq option to process references worker
  • Loading branch information
kmycode authored Sep 27, 2023
1 parent 75c0e51 commit bb47ab1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/services/process_references_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def self.perform_worker_async(status, reference_parameters, urls)
return unless need_process?(status, reference_parameters, urls)

Rails.cache.write("status_reference:#{status.id}", true, expires_in: 10.minutes)
ProcessReferencesWorker.perform_async(status.id, reference_parameters, urls, no_fetch_urls: [])
ProcessReferencesWorker.perform_async(status.id, reference_parameters, urls, [])
end

def self.call_service(status, reference_parameters, urls)
Expand Down Expand Up @@ -133,6 +133,6 @@ def remove_old_references
end

def launch_worker
ProcessReferencesWorker.perform_async(@status.id, @reference_parameters, @urls, no_fetch_urls: @no_fetch_urls)
ProcessReferencesWorker.perform_async(@status.id, @reference_parameters, @urls, @no_fetch_urls)
end
end
6 changes: 4 additions & 2 deletions app/workers/process_references_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
class ProcessReferencesWorker
include Sidekiq::Worker

def perform(status_id, ids, urls, no_fetch_urls: nil)
ProcessReferencesService.new.call(Status.find(status_id), ids || [], urls: urls || [], no_fetch_urls: no_fetch_urls || [])
sidekiq_options queue: 'pull', retry: 3

def perform(status_id, ids, urls, no_fetch_urls = nil)
ProcessReferencesService.new.call(Status.find(status_id), ids || [], urls: urls || [], no_fetch_urls: no_fetch_urls)
rescue ActiveRecord::RecordNotFound
true
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mastodon/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def kmyblue_major
end

def kmyblue_minor
1
2
end

def kmyblue_flag
Expand Down

0 comments on commit bb47ab1

Please sign in to comment.