1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

repair usage of CancellationToken

Co-Authored-By: n0099 <n@n0099.net>
This commit is contained in:
cdwcgt 2023-04-09 21:54:26 +09:00
parent 1d5c87039e
commit 13b522e825
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2

View File

@ -60,7 +60,7 @@ namespace osu.Game.Database
/// If specified CancellationToken, then use it. Otherwise use PostNotification's CancellationToken.
/// </param>
/// <returns></returns>
public async Task<bool> ExportAsync(TModel model, CancellationToken? cancellationToken = null)
public async Task<bool> ExportAsync(TModel model, CancellationToken cancellationToken = default)
{
// check if the model is being exporting already
if (!exporting_models.Contains(model))
@ -93,7 +93,8 @@ namespace osu.Game.Database
{
using (var stream = exportStorage.CreateFileSafely(filename))
{
success = await ExportToStreamAsync(model, stream, notification, cancellationToken ?? notification.CancellationToken).ConfigureAwait(false);
success = await ExportToStreamAsync(model, stream, notification,
cancellationToken == CancellationToken.None ? notification.CancellationToken : cancellationToken).ConfigureAwait(false);
}
}
catch (OperationCanceledException)