From 91f83f781cf084f74d89a282251a47cba19716b7 Mon Sep 17 00:00:00 2001 From: Accusys Date: Sat, 17 Oct 2026 18:24:26 +0800 Subject: [PATCH] fix(tkg): remove tkg_nodes.json file check in is_tkg_done() - TKG processor writes to database, not file - Check database + trace directories instead - Fix infinite loop for completed files - Related: Phase 0 preparation for dynamic concurrency --- src/worker/job_worker.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/worker/job_worker.rs b/src/worker/job_worker.rs index 7babb65d..7e700ac6 100644 --- a/src/worker/job_worker.rs +++ b/src/worker/job_worker.rs @@ -2040,10 +2040,26 @@ impl JobWorker { .filter_map(|e| e.ok()) .filter(|e| e.file_name().to_string_lossy().starts_with("trace_")) .count(); - - return trace_count > 0; + + if trace_count == 0 { + tracing::warn!( + "[TKG] Database has {} records but no trace dirs for {}, returning false", + count, uuid + ); + return false; + } + + tracing::info!( + "[TKG] TKG done for {}: {} nodes in database, {} trace dirs", + uuid, count, trace_count + ); + return true; } + tracing::warn!( + "[TKG] Database has {} records but cannot read trace dir for {}, returning false", + count, uuid + ); false }