1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 16:12:54 +08:00

Set a busy timeout when creating an SQLIteConnection

This commit is contained in:
Dean Herbert 2017-09-23 19:22:53 +08:00
parent 8853cab911
commit a1b313620c

View File

@ -82,6 +82,13 @@ namespace osu.Game
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
private SQLiteConnection createConnection()
{
var conn = Host.Storage.GetDatabase(@"client");
conn.BusyTimeout = new TimeSpan(TimeSpan.TicksPerSecond * 10);
return conn;
}
private SQLiteConnection connection;
[BackgroundDependencyLoader]
@ -90,8 +97,7 @@ namespace osu.Game
dependencies.Cache(this);
dependencies.Cache(LocalConfig);
connection = Host.Storage.GetDatabase(@"client");
connection = createConnection();
connection.CreateTable<StoreVersion>();
dependencies.Cache(API = new APIAccess