Periodically verify the status of messages sent over mycelium

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-08-28 14:53:08 +02:00
parent 4b597cc445
commit 1551b4707b
10 changed files with 302 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
use crate::dag::{DagError, DagResult, FlowDag, build_flow_dag};
use crate::models::{
Actor, Context, Flow, FlowStatus, Job, JobStatus, Message, MessageFormatType, MessageStatus,
Runner,
Runner, TransportStatus,
};
use crate::storage::RedisDriver;
@@ -508,6 +508,8 @@ impl AppService {
timeout: job.timeout,
timeout_ack: 10,
timeout_result: job.timeout,
transport_id: None,
transport_status: None,
job: vec![job.clone()],
logs: Vec::new(),
created_at: ts,
@@ -589,6 +591,8 @@ impl AppService {
timeout: job.timeout,
timeout_ack: 10,
timeout_result: job.timeout,
transport_id: None,
transport_status: None,
job: vec![job.clone()],
logs: Vec::new(),
created_at: ts,
@@ -817,6 +821,21 @@ impl AppService {
.await
}
pub async fn update_message_transport(
&self,
context_id: u32,
caller_id: u32,
id: u32,
transport_id: Option<String>,
transport_status: Option<TransportStatus>,
) -> Result<(), BoxError> {
// Ensure message exists (provides clearer error)
let _ = self.redis.load_message(context_id, caller_id, id).await?;
self.redis
.update_message_transport(context_id, caller_id, id, transport_id, transport_status)
.await
}
pub async fn update_flow_env_vars_merge(
&self,
context_id: u32,