mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
Add test for Import::WatcherJob
This commit is contained in:
parent
200bc980e5
commit
b79bb9951c
7 changed files with 22 additions and 1246 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -26,6 +26,7 @@
|
|||
!/tmp/storage/.keep
|
||||
/tmp/imports/*
|
||||
!/tmp/imports/
|
||||
/tmp/imports/watched/*
|
||||
!/tmp/imports/watched/
|
||||
!/tmp/imports/watched/.keep
|
||||
!/tmp/imports/watched/put-your-files-here.txt
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
- Monkey patch for Geocoder to support http along with https for Photon API host was removed becausee it was breaking the reverse geocoding process. Now you can use only https for the Photon API host. This might be changed in the future
|
||||
|
||||
### Fixed
|
||||
|
||||
- Stats update is now being correctly triggered every 6 hours
|
||||
|
||||
# [0.14.7] - 2024-10-01
|
||||
|
||||
### Fixed
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ class StatCreatingJob < ApplicationJob
|
|||
queue_as :stats
|
||||
|
||||
def perform(user_ids = nil)
|
||||
user_ids = user_ids.nil? ? User.pluck(:id) : Array(user_ids)
|
||||
|
||||
CreateStats.new(user_ids).call
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
# config/schedule.yml
|
||||
|
||||
stat_creating_job:
|
||||
cron: "0 */6 * * *" # every 6 hours
|
||||
cron: "0 */6 * * *" # every 6 hour
|
||||
class: "StatCreatingJob"
|
||||
queue: default
|
||||
queue: stats
|
||||
|
||||
area_visits_calculation_scheduling_job:
|
||||
cron: "0 0 * * *" # every day at 0:00
|
||||
class: "AreaVisitsCalculationSchedulingJob"
|
||||
queue: default
|
||||
queue: visit_suggesting
|
||||
|
||||
visit_suggesting_job:
|
||||
cron: "0 1 * * *" # every day at 1:00
|
||||
class: "VisitSuggestingJob"
|
||||
queue: default
|
||||
queue: visit_suggesting
|
||||
|
||||
watcher_job:
|
||||
cron: "0 */1 * * *" # every 1 hour
|
||||
class: "Import::WatcherJob"
|
||||
queue: default
|
||||
queue: imports
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ RSpec.describe Import::ImmichGeodataJob, type: :job do
|
|||
it 'calls Immich::ImportGeodata' do
|
||||
expect_any_instance_of(Immich::ImportGeodata).to receive(:call)
|
||||
|
||||
Import::ImmichGeodataJob.perform_now(user.id)
|
||||
described_class.perform_now(user.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Import::WatcherJob, type: :job do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
describe '#perform' do
|
||||
it 'calls Imports::Watcher' do
|
||||
expect_any_instance_of(Imports::Watcher).to receive(:call)
|
||||
|
||||
described_class.perform_now
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue