Skip to content

Commit

Permalink
Parallelise delete calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sambiramairelogic committed Jan 29, 2025
1 parent 644b6a9 commit 8ff6c6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,8 @@ public async Task<IEnumerable<string>> RemoveUnconfirmedProvisionalBookings()
return indexDocuments.Select(i => i.Reference).ToList();
}

public async Task DeleteBooking(string reference, string site)
{
await indexStore.DeleteDocument(reference, "booking_index");
await bookingStore.DeleteDocument(reference, site);
}
public async Task DeleteBooking(string reference, string site) => await Task.WhenAll(
indexStore.DeleteDocument(reference, "booking_index"),
bookingStore.DeleteDocument(reference, site)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ public async Task RecalculateAppointmentStatuses_DeletesProvisionalAppointments(
It.Is<AppointmentStatus>(s => s == AppointmentStatus.Orphaned)),
Times.Once);

_bookingsDocumentStore.Verify(x => x.DeleteProvisionalBooking(
_bookingsDocumentStore.Verify(x => x.DeleteBooking(
It.Is<string>(s => s == "2"),
It.Is<string>(s => s == "mock-site")),
Times.Once);
Expand Down

0 comments on commit 8ff6c6b

Please sign in to comment.