mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Move cache cleaning to a job
This commit is contained in:
parent
2eb96bcdf1
commit
0dfdeac5c5
3 changed files with 12 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
9
app/jobs/cache/cleaning_job.rb
vendored
Normal file
9
app/jobs/cache/cleaning_job.rb
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Cache::CleaningJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform
|
||||
Cache::Clean.call
|
||||
end
|
||||
end
|
||||
|
|
@ -7,7 +7,7 @@ require_relative 'application'
|
|||
Rails.application.initialize!
|
||||
|
||||
# Clear the cache
|
||||
Cache::Clean.call
|
||||
Cache::CleaningJob.perform_later
|
||||
|
||||
# Preheat the cache
|
||||
Cache::PreheatingJob.perform_later
|
||||
|
|
|
|||
Loading…
Reference in a new issue