From 80573d4c949c9455f29da0574c55ac51baa6be74 Mon Sep 17 00:00:00 2001 From: FabioDefilippo Date: Sat, 16 May 2026 15:02:56 +0200 Subject: [PATCH 1/2] Added Reset for correct time in log Added watch.Reset(); for corrected time in log --- src/Runtime/CollectionTask.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Runtime/CollectionTask.cs b/src/Runtime/CollectionTask.cs index e186b08..c96aba9 100644 --- a/src/Runtime/CollectionTask.cs +++ b/src/Runtime/CollectionTask.cs @@ -141,6 +141,7 @@ internal async Task ConsumeSearchResults() d.Properties.Add("collected", true); } await _outputChannel.Writer.WriteAsync(processed); + watch.Reset(); } catch (Exception e) { @@ -152,4 +153,4 @@ internal async Task ConsumeSearchResults() log.LogDebug("Consumer task on thread {id} completed", Thread.CurrentThread.ManagedThreadId); } } -} \ No newline at end of file +} From de1db4df021cda03e82134e4e947c0d36993c71f Mon Sep 17 00:00:00 2001 From: FabioDefilippo Date: Sat, 16 May 2026 15:13:11 +0200 Subject: [PATCH 2/2] Refactor watch reset position in CollectionTask Reset the watch timer only after processing an item. --- src/Runtime/CollectionTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runtime/CollectionTask.cs b/src/Runtime/CollectionTask.cs index c96aba9..2c6a1f1 100644 --- a/src/Runtime/CollectionTask.cs +++ b/src/Runtime/CollectionTask.cs @@ -133,6 +133,7 @@ internal async Task ConsumeSearchResults() watch.Stop(); log.LogTrace("Consumer {ThreadID} took {time} ms to process {obj}", threadId, watch.Elapsed.TotalMilliseconds, res.DisplayName); + watch.Reset(); if (processed == null) continue; @@ -141,7 +142,6 @@ internal async Task ConsumeSearchResults() d.Properties.Add("collected", true); } await _outputChannel.Writer.WriteAsync(processed); - watch.Reset(); } catch (Exception e) {