Skip to content

backend: Add graceful shutdown signal handler for queue workers - #1080

Merged
ONEONUORA merged 2 commits into
Fracverse:masterfrom
David-Isaac-design:fix/956-graceful-shutdown-workers
Sep 25, 2026
Merged

ONEONUORA merged 2 commits into
Fracverse:masterfrom
David-Isaac-design:fix/956-graceful-shutdown-workers

Conversation

@David-Isaac-design

Copy link
Copy Markdown
Contributor

Summary

Adds graceful shutdown handling for the background disbursement queue worker.

Closes #956

Changes

  • Listen for tokio::signal::ctrl_c() in main.
  • Signal the disbursement worker when shutdown is requested.
  • Use tokio::select! in the worker loop to handle shutdown between processing cycles.
  • Allow the currently active batch item to finish before the worker exits.
  • Await the worker task before the application exits and database resources are released.

Validation

  • git diff --check passes.
  • Rust formatting, check, and tests could not be run because cargo is not available in the current environment.
  • Only the files required for the worker shutdown flow were changed.

@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@David-Isaac-design 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! 🚀

Learn more about application limits

@ONEONUORA ONEONUORA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ONEONUORA
ONEONUORA merged commit d9594d2 into Fracverse:master Sep 25, 2026
10 of 11 checks passed
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.

backend: ADD GRACEFUL SHUTDOWN SIGNAL HANDLER FOR BACKGROUND QUEUE WORKERS

3 participants