Skip to content

Commit

Permalink
Added sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakhi Agrawal committed Nov 12, 2024
1 parent b93dba4 commit 335f481
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ public void clearRelationshipsByEntity(@Nonnull Urn urn,
// Exit if fewer than batchSize rows were affected, indicating all rows are processed
break;
}
// Sleep for 1 millisecond to reduce load
try {
Thread.sleep(1);
} catch (InterruptedException e) {
Thread.currentThread().interrupt(); // Restore interrupted status
throw new RuntimeException("Batch deletion interrupted", e);
}
}
log.info("Cleared relationships in {} batches", batchCount);
}
Expand Down

0 comments on commit 335f481

Please sign in to comment.