File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ use crate::{
55 traits:: { LoadConfig , Server as AdapterServer } ,
66} ;
77use code0_flow:: flow_service:: FlowUpdateService ;
8- use std:: sync:: Arc ;
9- use tokio:: signal;
8+ use std:: { sync:: Arc , time :: Duration } ;
9+ use tokio:: { signal, time :: sleep } ;
1010use tonic:: transport:: Server ;
1111use tonic_health:: pb:: health_server:: HealthServer ;
1212use tucana:: shared:: { AdapterConfiguration , RuntimeFeature } ;
@@ -91,7 +91,22 @@ impl<C: LoadConfig> ServerRunner<C> {
9191 config. aquila_token . clone ( ) ,
9292 )
9393 . await ;
94- definition_service. send ( ) . await ;
94+
95+ let mut success = false ;
96+ let mut count = 1 ;
97+ while !success {
98+ success = definition_service. send_with_status ( ) . await ;
99+ if success {
100+ break ;
101+ }
102+
103+ log:: warn!(
104+ "Updating definitions failed, trying again in 2 secs (retry number {})" ,
105+ count
106+ ) ;
107+ count += 1 ;
108+ sleep ( Duration :: from_secs ( 3 ) ) . await ;
109+ }
95110 }
96111
97112 let health_task = if config. with_health_service {
You can’t perform that action at this time.
0 commit comments