Disable retries for some background jobs

This commit is contained in:
Eugene Burmakin 2024-10-03 15:33:31 +02:00
parent 880fd085c7
commit 40e5477a00
7 changed files with 7 additions and 1 deletions

View file

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- 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
- Disable retries for some background jobs
### Fixed

View file

@ -2,6 +2,7 @@
class AreaVisitsCalculatingJob < ApplicationJob
queue_as :default
sidekiq_options retry: false
def perform(user_id)
user = User.find(user_id)

View file

@ -2,6 +2,7 @@
class AreaVisitsCalculationSchedulingJob < ApplicationJob
queue_as :default
sidekiq_options retry: false
def perform
User.find_each { AreaVisitsCalculatingJob.perform_later(_1.id) }

View file

@ -2,6 +2,7 @@
class Import::ImmichGeodataJob < ApplicationJob
queue_as :imports
sidekiq_options retry: false
def perform(user_id)
user = User.find(user_id)

View file

@ -2,6 +2,7 @@
class Import::WatcherJob < ApplicationJob
queue_as :imports
sidekiq_options retry: false
def perform
Imports::Watcher.new.call

View file

@ -2,6 +2,7 @@
class VisitSuggestingJob < ApplicationJob
queue_as :visit_suggesting
sidekiq_options retry: false
def perform(user_ids: [], start_at: 1.day.ago, end_at: Time.current)
users = user_ids.any? ? User.where(id: user_ids) : User.all

View file

@ -8,7 +8,7 @@ class Imports::Watcher
def call
%w[*.gpx *.json].each do |pattern|
Dir[WATCHED_DIR_PATH.join(pattern)].each do |file_path|
# valid file_path example: "email@dawarich.app_2024-01-01-2024-01-31.json"
# valid file_name example: "email@dawarich.app_2024-01-01-2024-01-31.json"
file_name = File.basename(file_path)
user = find_user(file_name)