Skip to content

Commit 54c770e

Browse files
committed
Throttle fallback graph build progress logging
1 parent 323773e commit 54c770e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

engine/src/main/java/com/arcadedb/index/vector/LSMVectorIndex.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,10 @@ private void buildGraphFromScratchWithRetry(final GraphBuildCallback graphCallba
796796
return;
797797

798798
final long now = System.currentTimeMillis();
799-
final boolean shouldLog = processedNodes == totalNodes
800-
|| (now - lastLogTimeMs[0] >= 2000 && processedNodes != lastLoggedProcessed[0]);
799+
final boolean progressed = processedNodes != lastLoggedProcessed[0];
800+
final boolean timeElapsed = now - lastLogTimeMs[0] >= 2000;
801+
final boolean reachedEnd = processedNodes >= totalNodes && lastLoggedProcessed[0] != totalNodes;
802+
final boolean shouldLog = progressed && (timeElapsed || reachedEnd);
801803

802804
if (shouldLog) {
803805
LogManager.instance().log(this, Level.INFO,

0 commit comments

Comments
 (0)