Skip to content

Commit aa3557a

Browse files
committed
Improve readability
1 parent 1327bea commit aa3557a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/ServiceControl.Audit/Auditing/AuditIngestion.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,18 @@ async Task EnsureStarted(CancellationToken cancellationToken = default)
7676
await startStopSemaphore.WaitAsync(cancellationToken);
7777
logger.Debug("Ensure started. Start/stop semaphore acquired");
7878

79-
if (!unitOfWorkFactory.CanIngestMore())
79+
var canIngest = unitOfWorkFactory.CanIngestMore();
80+
81+
logger.DebugFormat("Ensure started {0}", canIngest);
82+
83+
if (canIngest)
84+
{
85+
await SetUpAndStartInfrastructure(cancellationToken);
86+
}
87+
else
8088
{
8189
await StopAndTeardownInfrastructure(cancellationToken);
82-
return;
8390
}
84-
85-
await SetUpAndStartInfrastructure(cancellationToken);
8691
}
8792
catch (Exception e)
8893
{

0 commit comments

Comments
 (0)