mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Only lock database for the duration of a model restoration
This commit is contained in:
parent
c85d7c8b3f
commit
f8eb07b211
@ -436,20 +436,17 @@ namespace osu.Game.Database
|
||||
|
||||
int i = 0;
|
||||
|
||||
using (ContextFactory.GetForWrite())
|
||||
foreach (var item in items)
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (notification.State == ProgressNotificationState.Cancelled)
|
||||
// user requested abort
|
||||
return;
|
||||
if (notification.State == ProgressNotificationState.Cancelled)
|
||||
// user requested abort
|
||||
return;
|
||||
|
||||
notification.Text = $"Restoring ({++i} of {items.Count})";
|
||||
notification.Text = $"Restoring ({++i} of {items.Count})";
|
||||
|
||||
Undelete(item);
|
||||
Undelete(item);
|
||||
|
||||
notification.Progress = (float)i / items.Count;
|
||||
}
|
||||
notification.Progress = (float)i / items.Count;
|
||||
}
|
||||
|
||||
notification.State = ProgressNotificationState.Completed;
|
||||
|
Loading…
Reference in New Issue
Block a user