mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -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:
|
- run:
|
||||||
name: Database Setup
|
name: Database Setup
|
||||||
command: |
|
command: |
|
||||||
bundle exec bin/rails db:create
|
bundle exec rails db:create
|
||||||
bundle exec bin/rails db:schema:load
|
bundle exec rails db:schema:load
|
||||||
- run:
|
- run:
|
||||||
name: Run RSpec tests
|
name: Run RSpec tests
|
||||||
command: bundle exec rspec
|
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!
|
Rails.application.initialize!
|
||||||
|
|
||||||
# Clear the cache
|
# Clear the cache
|
||||||
Cache::Clean.call
|
Cache::CleaningJob.perform_later
|
||||||
|
|
||||||
# Preheat the cache
|
# Preheat the cache
|
||||||
Cache::PreheatingJob.perform_later
|
Cache::PreheatingJob.perform_later
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue