1
0

Optimizing async tasks (ConfigureAwait(false))

This commit is contained in:
2023-11-03 10:12:30 +01:00
parent 18b9627ea4
commit ca76966827
11 changed files with 61 additions and 43 deletions

View File

@@ -236,7 +236,7 @@ namespace AMWD.Common.Logging
QueueItem[] items;
try
{
items = await queue.DequeueAvailableAsync(cancellationToken: token);
items = await queue.DequeueAvailableAsync(cancellationToken: token).ConfigureAwait(false);
}
catch (OperationCanceledException)
{
@@ -302,10 +302,10 @@ namespace AMWD.Common.Logging
sb.Append(message.Replace("\n", "\n" + timestampPadding + logLevelPadding));
await fileWriter.WriteLineAsync(sb.ToString());
await fileWriter.WriteLineAsync(sb.ToString()).ConfigureAwait(false);
}
await fileWriter.FlushAsync();
await fileWriter.FlushAsync().ConfigureAwait(false);
}
}