Repository navigation
[ruby] preserve periodic occurrence schedules - #1537
Merged
Merged
Conversation
Driver consumers need to compare persisted timestamps without inspecting which database backend encodes them. Private SQL helpers also cannot be forwarded through delegating driver wrappers. Expose `normalize_time` and `time_precision` on the internal driver contract. Share normalization with SQL timestamp encoding and SQLite insertion formatting, preserving microsecond truncation on Postgres and millisecond rounding on SQLite. Return precision as an exact duration in seconds. Shared driver examples cover persisted queue and job timestamps at precision boundaries, UTC conversion, delegation, and the smallest representable increment across both adapters and database engines.
bgentry
force-pushed
the
bg/ruby-periodic-schedule-fallback
branch
from
October 25, 2026 02:34
616ab62 to
d9796f6
Compare
brandur
approved these changes
Oct 25, 2026
bgentry
force-pushed
the
bg/ruby-periodic-schedule-fallback
branch
from
October 25, 2026 02:45
d9796f6 to
c18065f
Compare
Delayed periodic work currently uses insertion time instead of the schedule's occurrence time. Share the ordinary insertion pipeline and retain one argument-option lookup. Preserve explicit constructor and argument schedules, along with ordinary key and state preparation, then apply an occurrence fallback to the stored schedule before insertion hooks run. Carry occurrence times from the registry without changing its existing due-job API. Timestamp initial startup work at its first pass and later work at its occurrence. Cover option precedence with frozen objects, prepared keys and states, late periodic passes, and delayed startup work.
bgentry
force-pushed
the
bg/ruby-periodic-schedule-fallback
branch
from
October 25, 2026 03:43
c18065f to
c2541e0
Compare
bgentry
marked this pull request as ready for review
October 25, 2026 19:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Delayed periodic passes currently stamp jobs with insertion time, losing their original occurrence timestamps.
Default each job to its scheduled occurrence time while preserving schedules supplied by the constructor or job arguments. Preserve ordinary uniqueness and state preparation, with one argument-option lookup and insertion hooks receiving the final schedule. Use the actual first pass time for
run_on_start, and retain scheduled occurrence times for later runs.This is stacked on the internal driver timestamp contract in #1536.