chore(task-worker): prepare DigitalOcean deployment#60
Open
harshlocham wants to merge 1 commit into
Open
Conversation
Owner
harshlocham
commented
May 5, 2026
- Add DigitalOcean App Platform worker spec
- Add graceful shutdown for SIGTERM and SIGINT
- Point the worker spec at the deployment branch
- Add DigitalOcean App Platform worker spec - Add graceful shutdown for SIGTERM and SIGINT - Point the worker spec at the deployment branch
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Prepares the task-worker service for deployment on DigitalOcean App Platform and adds signal handling intended to support graceful shutdown in production.
Changes:
- Added SIGTERM/SIGINT handlers and a
shuttingDownflag to stop the worker loops. - Added a DigitalOcean App Platform worker spec (
.do/app.yaml) for building/deploying the task-worker via its Dockerfile. - Updated the worker’s polling loops to terminate when shutdown is initiated.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/task-worker/index.ts | Adds shutdown signal handlers and uses shuttingDown to exit the main loops. |
| .do/app.yaml | Introduces a DigitalOcean App Platform worker configuration for task-worker deployment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+65
to
+86
| async function shutdown(signal: NodeJS.Signals) { | ||
| if (shuttingDown) return; | ||
| shuttingDown = true; | ||
|
|
||
| console.log(`task-worker received ${signal}, shutting down gracefully...`); | ||
|
|
||
| try { | ||
| if (redis) { | ||
| await redis.quit(); | ||
| } | ||
| } catch (error) { | ||
| console.warn("task-worker redis shutdown failed", error); | ||
| } | ||
|
|
||
| try { | ||
| await mongoose.disconnect(); | ||
| } catch (error) { | ||
| console.warn("task-worker mongoose shutdown failed", error); | ||
| } | ||
|
|
||
| process.exit(0); | ||
| } |
Comment on lines
+8
to
+11
| github: | ||
| repo: harshlocham/chat-app | ||
| branch: fix/socket-cookie-domain-auth | ||
| deploy_on_push: true |
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.