Skip to content

Commit

Permalink
do not try to schedule jobs during asset precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Nov 25, 2024
1 parent 8439bef commit a4b1ab0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions config/initializers/shrine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
nil # migrations probably haven't run yet to create library table
end

begin
unless ENV.fetch("PRECOMPILE", nil)
Sidekiq::Cron::Job.create(
name: "clear-shrine-cache",
cron: "every hour",
class: "CacheSweepJob"
)
rescue RedisClient::CannotConnectError
end
end
3 changes: 1 addition & 2 deletions config/initializers/usage_reports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

Rails.application.config.after_initialize do
# Make sure the schedule is loaded correctly
UsageReport.set_schedule!
rescue RedisClient::CannotConnectError
UsageReport.set_schedule! unless ENV.fetch("PRECOMPILE", nil)
end
1 change: 1 addition & 0 deletions docker/build.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ RUN \
DATABASE_URL="nulldb://user:pass@localhost/db" \
SECRET_KEY_BASE="placeholder" \
RACK_ENV="production" \
PRECOMPILE="true" \
bundle exec rake assets:precompile

0 comments on commit a4b1ab0

Please sign in to comment.