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:
parent
1d5c87039e
commit
13b522e825
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user