mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-02 06:51:40 +00:00
Move database clean from cron to Sidekiq scheduler
After moving the remaining tasks from schedule.rb to sidekiq.yml, we can remove whenever and won't rely on cron any more. That will simplify the setup and migration to a new server.
This commit is contained in:
18
spec/jobs/rake_job_spec.rb
Normal file
18
spec/jobs/rake_job_spec.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "tasks/data/remove_transient_data"
|
||||
|
||||
RSpec.describe RakeJob do
|
||||
let(:task_string) { "ofn:data:remove_transient_data" }
|
||||
|
||||
it "calls the removal service" do
|
||||
expect(RemoveTransientData).to receive(:new).and_call_original
|
||||
RakeJob.perform_now(task_string)
|
||||
end
|
||||
|
||||
it "can be called several times" do
|
||||
expect(RemoveTransientData).to receive(:new).twice.and_call_original
|
||||
RakeJob.perform_now(task_string)
|
||||
RakeJob.perform_now(task_string)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user