From a5a274587cdb604ded07c2292b773d60178a0ae1 Mon Sep 17 00:00:00 2001 From: Praven Kuttappan <55455725+praveenkuttappan@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:51:17 -0500 Subject: [PATCH] Add delay between processing cleanup of PR API review revisions (#7433) Co-authored-by: praveenkuttappan --- src/dotnet/APIView/APIViewWeb/Managers/PullRequestManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dotnet/APIView/APIViewWeb/Managers/PullRequestManager.cs b/src/dotnet/APIView/APIViewWeb/Managers/PullRequestManager.cs index bc5554ae12e..3ed322dd1d9 100644 --- a/src/dotnet/APIView/APIViewWeb/Managers/PullRequestManager.cs +++ b/src/dotnet/APIView/APIViewWeb/Managers/PullRequestManager.cs @@ -129,11 +129,12 @@ public async Task CleanupPullRequestData() { try { - if (await IsPullRequestEligibleForCleanup(prModel)) + if (prModel.APIRevisionId != null && await IsPullRequestEligibleForCleanup(prModel)) { - _telemetryClient.TrackEvent("Closing review created for pull request " + prModel.PullRequestNumber); + _telemetryClient.TrackEvent($"Closing review {prModel.ReviewId}/{prModel.APIRevisionId} created for pull request {prModel.PullRequestNumber}"); await ClosePullRequestAPIRevision(prModel); } + await Task.Delay(500); } catch (Exception ex) {