@@ -2,8 +2,8 @@ use crate::app::{AppManagerRef, SHUFFLE_SERVER_ID, SHUFFLE_SERVER_IP};
22use crate :: config:: Config ;
33use crate :: grpc:: protobuf:: uniffle:: coordinator_server_client:: CoordinatorServerClient ;
44use crate :: grpc:: protobuf:: uniffle:: { ShuffleServerHeartBeatRequest , ShuffleServerId } ;
5+ use crate :: health_service:: HealthService ;
56use crate :: runtime:: manager:: RuntimeManager ;
6- use crate :: util:: get_local_ip;
77use log:: info;
88use std:: time:: Duration ;
99use tonic:: transport:: Channel ;
@@ -13,7 +13,16 @@ const DEFAULT_SHUFFLE_SERVER_TAG: &str = "ss_v4";
1313pub struct HeartbeatTask ;
1414
1515impl HeartbeatTask {
16- pub fn init ( config : & Config , runtime_manager : RuntimeManager , app_manager : AppManagerRef ) {
16+ pub fn init (
17+ config : & Config ,
18+ runtime_manager : & RuntimeManager ,
19+ app_manager : & AppManagerRef ,
20+ health_service : & HealthService ,
21+ ) {
22+ let runtime_manager = runtime_manager. clone ( ) ;
23+ let app_manager = app_manager. clone ( ) ;
24+ let health_service = health_service. clone ( ) ;
25+
1726 let coordinator_quorum = config. coordinator_quorum . clone ( ) ;
1827 let tags = config. tags . clone ( ) . unwrap_or ( vec ! [ ] ) ;
1928
@@ -48,7 +57,7 @@ impl HeartbeatTask {
4857 all_tags. push ( DEFAULT_SHUFFLE_SERVER_TAG . to_string ( ) ) ;
4958 all_tags. extend_from_slice ( & * tags) ;
5059
51- let healthy = app_manager . store_is_healthy ( ) . await . unwrap_or ( false ) ;
60+ let healthy = health_service . is_healthy ( ) . await . unwrap_or ( false ) ;
5261 let memory_snapshot = app_manager
5362 . store_memory_snapshot ( )
5463 . await
0 commit comments