Combined "enqueue automations poll" operations into one#27909
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR refactors the automation polling scheduler to unify immediate and deferred scheduling. The Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This comment was marked as outdated.
This comment was marked as outdated.
61ed318 to
46ff89a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
towards https://linear.app/ghost/issue/NY-1286 This change should have no user impact. Before (pseudocode): ``` const enqueuePollNow = () => { dispatch(StartAutomationsPollEvent.create()); }; const enqueuePollAt = (date) => { scheduler.at(date, 'PUT', '/automations/poll'); }; ``` After (pseudocode): ``` const enqueuePollAt = (date) => { if (new Date() < date) { dispatch(StartAutomationsPollEvent.create()); } else { scheduler.at(date, 'PUT', '/automations/poll'); } }; ``` I think this is a useful change on its own, but it'll also make [an upcoming change][0] easier. [0]: https://linear.app/ghost/issue/NY-1286
46ff89a to
7a12c14
Compare
towards https://linear.app/ghost/issue/NY-1286
This change should have no user impact.
Before (pseudocode):
After (pseudocode):
I think this is a useful change on its own (makes it easier for functions that want this behavior), but it'll also make an upcoming change easier.