mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 02:23:21 +08:00
Remove weird catch logic
This commit is contained in:
parent
2a3e03695c
commit
5d78561aa3
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@ -40,10 +39,8 @@ namespace osu.Game.Database
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default)
|
private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
try
|
using (var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate)))
|
||||||
{
|
{
|
||||||
using var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate));
|
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int fileCount = model.Files.Count();
|
int fileCount = model.Files.Count();
|
||||||
bool fileMissing = false;
|
bool fileMissing = false;
|
||||||
@ -78,14 +75,6 @@ namespace osu.Game.Database
|
|||||||
Logger.Log("Some of model files are missing, they will not be included in the archive", LoggingTarget.Database, LogLevel.Error);
|
Logger.Log("Some of model files are missing, they will not be included in the archive", LoggingTarget.Database, LogLevel.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ObjectDisposedException)
|
|
||||||
{
|
|
||||||
// outputStream may close before writing when request cancel.
|
|
||||||
if (cancellationToken.IsCancellationRequested)
|
|
||||||
return;
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user