Implemented the queue-backed execution path#416
Open
codefather2026 wants to merge 2 commits into
Open
Conversation
|
@codefather2026 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Author
|
Conflict resolved |
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.
Closes #348
Implemented the queue-backed execution path and moved the first reliability-critical flows onto it.
The core is a durable Postgres job table plus leased workers in src/jobs/job.entity.ts, src/jobs/jobQueue.service.ts, src/jobs/jobWorker.ts, and src/jobs/jobHandlers.ts. Jobs now support delayed availability, lease renewal, retries with backoff, dead-lettering, per-user correlation, and queue stats. The schema is added in src/migrations/1773000000000-CreateJobQueue.ts, and the worker boots with the API server in src/index.ts.
I rewired delayed transaction submission to enqueue durable jobs instead of keeping in-memory timers in src/services/delayedTransaction.service.ts. I also moved funding-triggered deployment work off the webhook request path in src/Gateway/webhook.service.ts, backed webhook idempotency with the DB helper more defensibly in src/Gateway/webhookIdempotency.service.ts, and added admin observability endpoints for queue stats and dead-letter inspection in src/Gateway/routes.ts. I added focused tests in tests/unit/job_worker.test.ts and tests/unit/delayedTransaction.service.test.ts.
Verification is still incomplete here because this checkout does not have installed Node tooling: npm run build failed with tsc: command not found, and there is no local node_modules/.bin/tsc. Before shipping, the next step is to restore dependencies, run the migration, then run npm run build and the targeted Jest tests.