feat: Fix yield accrual scheduler drift with setTimeout-based schedul… - #1507
Open
alamuoyeemmanuel7-create wants to merge 1 commit into
Open
alamuoyeemmanuel7-create wants to merge 1 commit into
alamuoyeemmanuel7-create wants to merge 1 commit into
Conversation
|
@alamuoyeemmanuel7-create Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…ing (Issue Junirezz#1450) - Replace setInterval with setTimeout for hour boundary scheduling - Implement msUntilNextHour() to compute next hour in milliseconds - Add recursive scheduling to prevent drift accumulation - On startup compute msUntilNextHour and schedule first run - Job runs at exact hour boundaries, not progressively later - Add comprehensive test suite with drift verification tests - Test mock Date.now at 12:00:30 and verify 13:00:00 scheduling - Maintain unchanged accrual calculation logic - Add environment variable YIELD_ACCRUAL_ENABLED for control Acceptance Criteria: ✅ Replace setInterval with setTimeout via msUntilNextHour ✅ Compute next hour on startup and after each run ✅ Test: 12:00:30 → next run at 13:00:00 (not 13:00:30) ✅ Existing accrual logic unchanged ✅ No drift accumulation even after 24+ hours ✅ Resilient to event loop delays
alamuoyeemmanuel7-create
force-pushed
the
feature/yield-accrual-scheduler-1450
branch
from
September 29, 2026 14:25
5635128 to
a119974
Compare
This branch has not been deployed
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.
closes #1450