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:
parent
8853cab911
commit
a1b313620c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user