feat: add in-memory redeploy queue backed by bunqueue - #53
Open
Zareix wants to merge 2 commits into
Open
Conversation
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.
What
Alternative implementation of the redeploy queue using bunqueue (embedded, in-memory) instead of
p-queue. See #52 for thep-queuevariant.Change
bunqueue(queue + worker in one object, embedded in the Bun process).src/lib/redeploy-queue.ts: aBunqueueinstance (in-memory — nodataPath) with:embedded: true— no broker, runs in-process;concurrency: 1— serializes redeploy passes;retry(exponential backoff, 3 attempts) — failed passes are retried;deduplication(10s TTL) — repeated webhooks within the window coalesce into one job.src/routes/api/stacks/redeploy.ts:POSTenqueues a job and returns202immediately;GETreports queue state (active/waiting).vs #52 (p-queue)
p-queue)bunqueue)Notes
bunqueue/clientis Bun-only (bun >= 1.3.9); the app already runs on Bun.SIGINT/SIGTERMhandler callsredeployQueue.close()for a clean worker shutdown.dataPathto persist jobs to SQLite instead (survives restart).tsc --noEmitis clean for these changes; the client + SSR bundles build fine. The final Nitro externals-tracing step fails on a pre-existing, unrelated issue (missing optional native depcpu-featuresunderdockerode→docker-modem→ssh2).