mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 13:28:03 +09:00
Set a busy timeout when creating an SQLIteConnection
This commit is contained in:
parent
8853cab911
commit
a1b313620c
@ -82,6 +82,13 @@ namespace osu.Game
|
|||||||
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
|
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
|
||||||
dependencies = new DependencyContainer(base.CreateLocalDependencies(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;
|
private SQLiteConnection connection;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -90,8 +97,7 @@ namespace osu.Game
|
|||||||
dependencies.Cache(this);
|
dependencies.Cache(this);
|
||||||
dependencies.Cache(LocalConfig);
|
dependencies.Cache(LocalConfig);
|
||||||
|
|
||||||
connection = Host.Storage.GetDatabase(@"client");
|
connection = createConnection();
|
||||||
|
|
||||||
connection.CreateTable<StoreVersion>();
|
connection.CreateTable<StoreVersion>();
|
||||||
|
|
||||||
dependencies.Cache(API = new APIAccess
|
dependencies.Cache(API = new APIAccess
|
||||||
|
Loading…
x
Reference in New Issue
Block a user