You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added an opt-in per-job deduplication mode for multi-instance deployments. The single-active-instance Redis lock remains one of the supported strategies. Set job_run_store = :redis, :database, or a custom object to enable dedup. [#43]
Each recurring job claims its schedule interval atomically, so different jobs run on different instances concurrently while every job still runs exactly once per interval across the whole cluster.
The new database backend lets you deduplicate without Redis. database_connection can be a Sequel::Database, an ActiveRecord connection pool, or an ActiveRecord connection (PostgreSQL, Mysql2, or Trilogy); the pool is also auto-detected when ActiveRecord or Sequel is loaded. schked generate-migration [--flavor=mysql] prints the required table DDL (MySQL 8.0+).
The ActiveRecord and Sequel adapters run entirely through their respective connection pools: claims (scheduler thread) and the internal cleanup sweep (work threads) share the pool safely, and dead connections are transparently replaced after a database restart or failover.
On MySQL, claims are decided by writing a unique claimer token and reading it back, not by affected_rows — Rails' mysql2 and trilogy adapters connect with CLIENT_FOUND_ROWS, which makes affected-rows counts unusable for insert-vs-duplicate detection.
BREAKING in dedup mode: every jobs are aligned to an absolute time grid so all instances share the same phase — the first firing is no longer relative to process start. cron, at, and in jobs are unaffected. interval jobs are no longer supported and raise a clear error, since their phase drifts with job duration and cannot be deduplicated.
BREAKING: Dropped support for Ruby 2.7. The minimum supported Ruby is now 3.0. CI no longer runs on 2.7, required_ruby_version is >= 3.0, and .standard.yml targets Ruby 3.0.