Skip to content

Commit

Permalink
Move cache cleaning to a job
Browse files Browse the repository at this point in the history
  • Loading branch information
Freika committed Dec 24, 2024
1 parent 2eb96bc commit 0dfdeac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- run:
name: Database Setup
command: |
bundle exec bin/rails db:create
bundle exec bin/rails db:schema:load
bundle exec rails db:create
bundle exec rails db:schema:load
- run:
name: Run RSpec tests
command: bundle exec rspec
Expand Down
9 changes: 9 additions & 0 deletions app/jobs/cache/cleaning_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class Cache::CleaningJob < ApplicationJob
queue_as :default

def perform
Cache::Clean.call
end
end
2 changes: 1 addition & 1 deletion config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Rails.application.initialize!

# Clear the cache
Cache::Clean.call
Cache::CleaningJob.perform_later

# Preheat the cache
Cache::PreheatingJob.perform_later

0 comments on commit 0dfdeac

Please sign in to comment.