Fixed race condition when scheduling email analytics jobs#29214
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughUpdated email analytics recurring-job scheduling to check internal newsletter and automation scheduling state before registering jobs. Added concurrency-focused tests using deferred query resolution to verify that concurrent scheduling calls register only one newsletter job and one automation job, while preserving the expected query invocation behavior. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run ghost:test:ci:integration |
✅ Succeeded | 2m 48s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 3m 4s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 3m 5s | View ↗ |
nx run ghost:test:e2e |
✅ Succeeded | 2m 33s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | 1s | View ↗ |
nx run-many -t test:unit -p ghost |
✅ Succeeded | 29s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 7s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 7s | View ↗ |
Additional runs (3) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-13 17:45:58 UTC
closes https://linear.app/ghost/issue/NY-1449 If `scheduleRecurringJobs` was called twice in rapid succession, we might schedule jobs twice. This fixes that. This is a long-standing issue that could rear its head when we call this function more often, which we plan to do soon. However, I think this is a useful bugfix on its own.
8a2416d to
cc09906
Compare
closes https://linear.app/ghost/issue/NY-1449 If `scheduleRecurringJobs` was called twice in rapid succession, we might schedule jobs twice. This fixes that. This is a long-standing issue that could rear its head when we call this function more often, which we plan to do soon. However, I think this is a useful bugfix on its own.

closes https://linear.app/ghost/issue/NY-1449
If
scheduleRecurringJobswas called twice in rapid succession, we might schedule jobs twice. This fixes that.This is a long-standing issue that could rear its head when we call this function more often, which we plan to do soon. However, I think this is a useful bugfix on its own.