Skip to content

Backfill PR: stabilize extraction flow and queue email submissions#5

Open
benkoppe wants to merge 6 commits into
retro/apr10-beforefrom
retro/apr10-after
Open

Backfill PR: stabilize extraction flow and queue email submissions#5
benkoppe wants to merge 6 commits into
retro/apr10-beforefrom
retro/apr10-after

Conversation

@benkoppe
Copy link
Copy Markdown
Contributor

This PR represents the totality of my changes made April 10th, intended to quickly repair the waitlist page, which were committed directly to main. The changes remain committed, but this PR helps document the changes.

  • Add cloudflare MCP
  • Fix extraction jobs problem
  • Run extraction job inline in waitUntil, eliminating self-HTTP chain
  • Fix extraction job overloading
  • Use cloudflare queues to ensure email submissions persist

The previous architecture POSTed to /api/extraction/process from within
waitUntil to kick off each page step. That self-HTTP call never reliably
fired in production, leaving all jobs permanently stuck at pending with
zero scanned messages.

Replace the entire chain with a single runExtractionJob() that loops over
all Gmail pages inline and is passed directly to ctx.waitUntil(). No
self-fetch, no recursive scheduling — the Worker just runs to completion.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loop-waitlist a15fdbe Commit Preview URL

Branch Preview URL
Apr 13 2026, 02:52 AM

Copy link
Copy Markdown

@anchen9 anchen9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ben! Amazing job with all of your work with cloudflare and extracting emails! Your research and efforts are super appreciated!

jobKey: message.body.jobKey
});

if (!result.done) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think re-enqueuing a batch when the job isn't quite done yet is clean & elegant!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants