Skip to content

Commit 5be3091

Browse files
committed
Better logging
1 parent 2531c4f commit 5be3091

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/ServiceControl.Audit/Auditing/AuditIngestion.cs

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

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
79+
if (!unitOfWorkFactory.CanIngestMore())
8880
{
81+
logger.Warn("Ensure started. Storage unable to ingest more. Ingestion will be paused");
82+
8983
await StopAndTeardownInfrastructure(cancellationToken);
84+
85+
return;
9086
}
87+
88+
logger.Debug("Ensure started. Storage able to ingest. Ingestion will be started");
89+
90+
await SetUpAndStartInfrastructure(cancellationToken);
9191
}
9292
catch (Exception e)
9393
{

0 commit comments

Comments
 (0)