private async Task ProcessInternal() { var tables = new[] { sagaStorageInitializer.GetSagaTableName() }; foreach (var table in tables) { logger.LogDebug($"Collecting expired data from table: {table}"); int deletedCount; var time = DateTime.UtcNow; do { deletedCount = await sagaStorage.DeleteExpiredData(table, time, options.ExpiredDataDeleteBatchCount); if (deletedCount == options.ExpiredDataDeleteBatchCount) { await Task.Delay(options.ExpiredDataPreBulkDeleteDelaySeconds * 1000); } } while (deletedCount == options.ExpiredDataDeleteBatchCount); } }