fix: Register sync_all_accounts cron job on Sidekiq startup (#764)

* fix: Register sync_all_accounts cron job on Sidekiq startup

AutoSyncScheduler.sync! was only called when changing settings in the UI,
so the nightly sync job was never registered. Now it's initialized when
Sidekiq starts, ensuring accounts sync nightly as configured.

* Utilize existing configure_server block

---------

Co-authored-by: Pieter <ptr@arcsec.org>
This commit is contained in:
Piet
2026-01-24 22:09:52 +01:00
committed by GitHub
parent c7ab25b866
commit 51d1a8f22b

View File

@@ -58,6 +58,14 @@ end
Sidekiq.configure_server do |config|
config.redis = redis_config
# Initialize auto-sync scheduler when Sidekiq server starts
config.on(:startup) do
AutoSyncScheduler.sync!
Rails.logger.info("[AutoSyncScheduler] Initialized sync_all_accounts cron job")
rescue => e
Rails.logger.error("[AutoSyncScheduler] Failed to initialize: #{e.message}")
end
end
Sidekiq.configure_client do |config|