mirror of
https://github.com/ppy/osu
synced 2024-12-13 18:37:04 +00:00
Only lock the database for the duration of a deletion
This commit is contained in:
parent
2519fd26a9
commit
dfaa9531f8
@ -400,20 +400,17 @@ namespace osu.Game.Database
|
||||
|
||||
int i = 0;
|
||||
|
||||
using (ContextFactory.GetForWrite())
|
||||
foreach (var b in items)
|
||||
{
|
||||
foreach (var b in items)
|
||||
{
|
||||
if (notification.State == ProgressNotificationState.Cancelled)
|
||||
// user requested abort
|
||||
return;
|
||||
if (notification.State == ProgressNotificationState.Cancelled)
|
||||
// user requested abort
|
||||
return;
|
||||
|
||||
notification.Text = $"Deleting {HumanisedModelName}s ({++i} of {items.Count})";
|
||||
notification.Text = $"Deleting {HumanisedModelName}s ({++i} of {items.Count})";
|
||||
|
||||
Delete(b);
|
||||
Delete(b);
|
||||
|
||||
notification.Progress = (float)i / items.Count;
|
||||
}
|
||||
notification.Progress = (float)i / items.Count;
|
||||
}
|
||||
|
||||
notification.State = ProgressNotificationState.Completed;
|
||||
|
Loading…
Reference in New Issue
Block a user