Started scheduling automation polls with scheduler#27437
Started scheduling automation polls with scheduler#27437EvanHahn wants to merge 1 commit intoseparate-scheduling-and-post-schedulingfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
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 pull request introduces an automations polling feature integrated with domain events and a scheduler. Changes include modifying 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 resolved.
This comment was marked as resolved.
✅ Actions performedReview triggered.
|
closes https://linear.app/ghost/issue/NY-1191 ref #27421 Before, we used `setTimeout` to schedule automation polls (with a TODO). Now, we properly use the scheduler.
| const timestamp = parseDatabaseDate(run.ready_at); | ||
| assert(timestamp >= before); | ||
| assert(timestamp <= after); | ||
| await db.knex.transaction(async (trx) => { |
There was a problem hiding this comment.
I recommend reviewing this with whitespace changes disabled. I had to put this in a transaction to avoid the race condition where a member is created and we pick up the run before we can assert on it.
closes https://linear.app/ghost/issue/NY-1191
ref #27421
Depends on #27421.
Before, we used
setTimeoutto schedule automation polls (with a TODO).Now, we properly use the scheduler.