From 51405318323139d75638495c884b8712b59d3e20 Mon Sep 17 00:00:00 2001 From: Maxime Van Hees Date: Wed, 6 Aug 2025 21:23:31 +0200 Subject: [PATCH] fixed: no output from rhai scripts --- src/lib.rs | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a1278dd..bf3807b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -106,8 +106,29 @@ impl Actor for OSISActor { let job_id = &job.id; let _db_path = &self.db_path; + // Debug: Log job details + info!( + "OSIS Actor '{}', Job {}: Processing job with context_id: {}, script length: {}", + OSIS, job_id, job.context_id, job.script.len() + ); + // Create job-specific logger - let (job_logger, _guard) = create_job_logger_with_guard("logs", "osis", job_id).unwrap(); + let (job_logger, guard) = match create_job_logger_with_guard("logs", "osis", job_id) { + Ok((logger, guard)) => { + info!( + "OSIS Actor '{}', Job {}: Job logger created successfully", + OSIS, job_id + ); + (logger, guard) + }, + Err(e) => { + error!( + "OSIS Actor '{}', Job {}: Failed to create job logger: {}", + OSIS, job_id, e + ); + return; + } + }; info!( "OSIS Actor '{}', Job {}: Starting sequential processing", @@ -226,8 +247,11 @@ impl Actor for OSISActor { } } + // Force flush logs before dropping guard + std::thread::sleep(std::time::Duration::from_millis(100)); + // Keep the guard alive until after processing - drop(_guard); + drop(guard); info!( "OSIS Actor '{}', Job {}: Sequential processing completed",