mirror of
https://github.com/chatwoot/chatwoot.git
synced 2026-07-10 21:17:01 +08:00
This change spreads Chatwoot Hub version checks across the day by scheduling each installation at a stable minute derived from its installation identifier, instead of having all instances check at the same fixed time. Closes - https://linear.app/chatwoot/issue/CW-6107/handle-the-spike-at-12-utc-on-chatwoot-hub What changed - Added `Internal::TriggerDailyScheduledItemsJob` to act as the daily trigger for deferred internal jobs. - Updated the version check cron entry to run once daily at `00:00 UTC` and enqueue the actual version check for that installation’s assigned minute of the day. - Used a deterministic minute-of-day derived from `ChatwootHub.installation_identifier` so the check time stays stable across deploys and restarts. - Kept the existing cron schedule key while switching it to the new orchestrator job. How to test - Run `bundle exec rspec spec/jobs/internal/check_new_versions_job_spec.rb spec/jobs/internal/trigger_daily_scheduled_items_job_spec.rb spec/configs/schedule_spec.rb` - In a Rails console, run `Internal::TriggerDailyScheduledItemsJob.perform_now` and verify `Internal::CheckNewVersionsJob` is enqueued with a `wait_until` later the same UTC day. - In Super Admin settings, use Refresh and verify the version check still runs immediately. --------- Co-authored-by: Sojan Jose <sojan@pepalo.com> |
||
|---|---|---|
| .. | ||
| monkey_patches | ||
| 00_init.rb | ||
| 01_inject_enterprise_edition_module.rb | ||
| 01_redis.rb | ||
| actioncable.rb | ||
| active_record_query_trace.rb | ||
| ai_agents.rb | ||
| application_controller_renderer.rb | ||
| assets.rb | ||
| audited.rb | ||
| backtrace_silencers.rb | ||
| content_security_policy.rb | ||
| cookies_serializer.rb | ||
| cors.rb | ||
| custom_error_codes.rb | ||
| datadog.rb | ||
| devise_token_auth.rb | ||
| devise.rb | ||
| event_handlers.rb | ||
| facebook_messenger.rb | ||
| feature_policy.rb | ||
| filter_parameter_logging.rb | ||
| geocoder.rb | ||
| git_sha.rb | ||
| inflections.rb | ||
| languages.rb | ||
| liquid_handler.rb | ||
| lograge.rb | ||
| mailer.rb | ||
| mime_types.rb | ||
| omniauth.rb | ||
| permissions_policy.rb | ||
| rack_attack.rb | ||
| rack_profiler.rb | ||
| rack_timeout.rb | ||
| searchkick.rb | ||
| secure_password.rb | ||
| sentry.rb | ||
| session_store.rb | ||
| sidekiq.rb | ||
| stripe.rb | ||
| warden_hooks.rb | ||
| wrap_parameters.rb | ||