Skip to content

chore(task-worker): prepare DigitalOcean deployment#60

Open
harshlocham wants to merge 1 commit into
mainfrom
fix/socket-cookie-domain-auth
Open

chore(task-worker): prepare DigitalOcean deployment#60
harshlocham wants to merge 1 commit into
mainfrom
fix/socket-cookie-domain-auth

Conversation

@harshlocham
Copy link
Copy Markdown
Owner

  • 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
Copilot AI review requested due to automatic review settings May 5, 2026 11:33
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-app Ready Ready Preview, Comment May 5, 2026 11:35am

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 shuttingDown flag 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 thread apps/task-worker/index.ts
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 thread .do/app.yaml
Comment on lines +8 to +11
github:
repo: harshlocham/chat-app
branch: fix/socket-cookie-domain-auth
deploy_on_push: true
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