1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Merge branch 'master' into Third-party-ruleset-filter-fix

This commit is contained in:
Bartłomiej Dach 2022-01-26 18:54:20 +01:00 committed by GitHub
commit df9658641c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -50,9 +50,14 @@ namespace osu.Game.Collections
this.storage = storage;
}
[Resolved(canBeNull: true)]
private DatabaseContextFactory efContextFactory { get; set; } = null!;
[BackgroundDependencyLoader]
private void load()
{
efContextFactory?.WaitForMigrationCompletion();
Collections.CollectionChanged += collectionsChanged;
if (storage.Exists(database_backup_name))

View File

@ -184,5 +184,11 @@ namespace osu.Game.Database
}
public static string CreateDatabaseConnectionString(string filename, Storage storage) => string.Concat("Data Source=", storage.GetFullPath($@"{filename}", true));
private readonly ManualResetEventSlim migrationComplete = new ManualResetEventSlim();
public void SetMigrationCompletion() => migrationComplete.Set();
public void WaitForMigrationCompletion() => migrationComplete.Wait();
}
}

View File

@ -128,6 +128,7 @@ namespace osu.Game.Database
}, TaskCreationOptions.LongRunning).ContinueWith(t =>
{
migrationCompleted.SetResult(true);
efContextFactory.SetMigrationCompletion();
});
}