-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
Code Cleanup / RefactoringTidying and Making NeatTidying and Making Neat
Description
Relates to: #1587
I've implemented a centralised shutdown for event listeners here.
The Torrust Tracker starts many jobs, most of which were handled independently. That means:
- There was no way to control them from the main app.
- They listed directly for the CRTl+c signal.
Not I'm refactoring the application to:
- Centralise job management in the
JobManager
type. - Capture the CTRL+c signal only by the main app, and the main app decides which job and when to shutdown.
This allows implementing centralised policies to handle jobs.
There are still some jobs that handle the CTRL+c signal directly:
- HTTP servers using axum:
torrust_server_lib::signals::global_shutdown_signal
- Job to update metrics:
torrust_tracker_swarm_coordination_registry::statistics::activity_metrics_updater::start_job
- Torrent cleanup jonb:
torrust_tracker_lib::bootstrap::jobs::torrent_cleanup::start_job
We should pass the cancellation token.
cc @da2ce7
Metadata
Metadata
Assignees
Labels
Code Cleanup / RefactoringTidying and Making NeatTidying and Making Neat