Skip to content

Conversation

@raphael-goetz
Copy link
Member

Resolves: #89

Copy link
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

This PR implements graceful shutdown on Ctrl+C/SIGINT for the Taurus service. The main changes restructure the application to use tokio::select! for monitoring multiple concurrent tasks (NATS worker and optional health service) and handle shutdown signals appropriately. The PR also includes dependency updates, improved logging throughout, and adds support for dynamic mode flow definition synchronization at startup.

Key Changes:

  • Added Ctrl+C signal handling using tokio::select! to gracefully coordinate shutdown of worker and health service tasks
  • Restructured main event loop to spawn tasks and monitor them for completion or shutdown signals
  • Enhanced error handling and replaced println! statements with structured log macros throughout
  • Added dynamic mode flow synchronization at startup and corresponding configuration

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
taurus/src/main.rs Core implementation of shutdown handling with tokio::select!, task spawning, improved logging, and dynamic mode sync
taurus/src/config/mod.rs Added definitions config field and changed default mode from STATIC to DYNAMIC
taurus/Cargo.toml Added "flow_service" feature flag to code0-flow dependency
Cargo.toml Updated dependencies (code0-flow 0.0.19, tucana 0.0.42, async-nats 0.45.0) and added "signal" feature to tokio
Cargo.lock Dependency lock file updates reflecting version changes and new transitive dependencies (walkdir, signal-hook-registry, etc.)
.env-example Added DEFINITIONS environment variable example

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +89 to +94
FlowUpdateService::from_url(
config.aquila_url.clone(),
config.definitions.clone().as_str(),
)
.send()
.await;
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

The result of FlowUpdateService::send().await is being ignored. If the sync fails, the application will continue without any indication of the failure. Consider logging an error or handling the failure case, e.g., if let Err(e) = FlowUpdateService::from_url(...).send().await { log::error!("Failed to sync flow definitions: {:?}", e); }

Copilot uses AI. Check for mistakes.
raphael-goetz and others added 2 commits November 27, 2025 16:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
@raphael-goetz raphael-goetz merged commit 141d10f into main Nov 27, 2025
1 check 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.

Shutdown on ctrl_c

2 participants