mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 19:44:09 +00:00
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:
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user