client: sort out shutdown procedure and harmonize with socks5-client (#2695)
* common/task: rename ShutdownNotifier to TaskManager * nym-client: return boxed error * nym-client: enable graceful shutdown * nym-client: task wait on shutdown to instead exit on closed channel * Fix build * Fix unused * changelog: update
This commit is contained in:
@@ -12,7 +12,7 @@ use nym_api_requests::models::{MixNodeBondAnnotated, MixnodeStatus};
|
||||
use rocket::fairing::AdHoc;
|
||||
use std::collections::HashMap;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use task::ShutdownListener;
|
||||
use task::TaskClient;
|
||||
use tokio::sync::RwLockReadGuard;
|
||||
use tokio::{
|
||||
sync::{watch, RwLock},
|
||||
@@ -174,7 +174,7 @@ impl NodeStatusCacheRefresher {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn run(&mut self, mut shutdown: ShutdownListener) {
|
||||
pub async fn run(&mut self, mut shutdown: TaskClient) {
|
||||
let mut fallback_interval = time::interval(self.fallback_caching_interval);
|
||||
while !shutdown.is_shutdown() {
|
||||
tokio::select! {
|
||||
|
||||
Reference in New Issue
Block a user