Skip to content

Commit

Permalink
re-register library storages before each job
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Jul 1, 2024
1 parent dd1c684 commit 8f161ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/jobs/application_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class ApplicationJob < ActiveJob::Base
before_perform do |job|
begin
SiteSettings.clear_cache
Library.register_all_storage
rescue
nil
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/library.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def register_storage
end

def self.register_all_storage
self.find_each(&:register_storage)
find_each(&:register_storage)
rescue ActiveRecord::StatementInvalid
nil # migrations probably haven't run yet to create library table
end
Expand Down

0 comments on commit 8f161ba

Please sign in to comment.