Skip to content

Commit

Permalink
RavenDB-21802 Should_Delete_All_Documents_Without_Timeout fix
Browse files Browse the repository at this point in the history
  • Loading branch information
efratshenhar authored and ppekrol committed Dec 20, 2023
1 parent 15fc5e8 commit 3fb0c92
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Raven.Client/Documents/BulkInsert/BulkInsertOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,14 @@ private static void HandleHeartbeat(object state)

private async Task SendHeartBeatAsync()
{
try
{
if (DateTime.UtcNow.Ticks - _lastWriteToStream.Ticks < _heartbeatCheckInterval.Ticks)
return;
if (DateTime.UtcNow.Ticks - _lastWriteToStream.Ticks < _heartbeatCheckInterval.Ticks)
return;

if (_streamLock.Wait(0) == false)
return; // if locked we are already writing
if (_streamLock.Wait(0) == false)
return; // if locked we are already writing

try
{
await ExecuteBeforeStore().ConfigureAwait(false);
EndPreviousCommandIfNeeded();
_options.ForTestingPurposes?.OnSendHeartBeat_DoBulkStore?.Invoke();
Expand Down

0 comments on commit 3fb0c92

Please sign in to comment.