diff --git a/Cargo.lock b/Cargo.lock index 43574ce..6f4ccf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,9 +271,9 @@ dependencies = [ [[package]] name = "code0-flow" -version = "0.0.30" +version = "0.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8401c34395889c3587792864120d2ff4354d24e79db8ffb01c17accc550d0de6" +checksum = "fa74faab97705675a1288230e0861d8a61a5456a4adc81387c8fc0505c11df5c" dependencies = [ "async-nats", "async-trait", @@ -2416,7 +2416,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 9c7d3a5..b033015 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ version = "0.0.0" edition = "2024" [workspace.dependencies] -code0-flow = { version = "0.0.30" } +code0-flow = { version = "0.0.31" } tucana = { version = "0.0.68", features = ["aquila"] } serde_json = { version = "1.0.138" } log = "0.4.27" diff --git a/crates/base/src/runner.rs b/crates/base/src/runner.rs index 0cbceb8..010403e 100644 --- a/crates/base/src/runner.rs +++ b/crates/base/src/runner.rs @@ -5,8 +5,8 @@ use crate::{ traits::{LoadConfig, Server as AdapterServer}, }; use code0_flow::flow_service::FlowUpdateService; -use std::sync::Arc; -use tokio::signal; +use std::{sync::Arc, time::Duration}; +use tokio::{signal, time::sleep}; use tonic::transport::Server; use tonic_health::pb::health_server::HealthServer; use tucana::shared::{AdapterConfiguration, RuntimeFeature}; @@ -91,7 +91,22 @@ impl ServerRunner { config.aquila_token.clone(), ) .await; - definition_service.send().await; + + let mut success = false; + let mut count = 1; + while !success { + success = definition_service.send_with_status().await; + if success { + break; + } + + log::warn!( + "Updating definitions failed, trying again in 2 secs (retry number {})", + count + ); + count += 1; + sleep(Duration::from_secs(3)).await; + } } let health_task = if config.with_health_service {