mirror of
https://github.com/ppy/osu
synced 2025-02-21 04:57:11 +00:00
Use a more elegant method of setting the connection timeout
This commit is contained in:
parent
9aa46bfb0d
commit
1514d8451e
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using osu.Framework.Logging;
|
||||
@ -50,8 +51,6 @@ namespace osu.Game.Database
|
||||
{
|
||||
this.connectionString = connectionString;
|
||||
|
||||
Database.SetCommandTimeout(new TimeSpan(TimeSpan.TicksPerSecond * 10));
|
||||
|
||||
var connection = Database.GetDbConnection();
|
||||
connection.Open();
|
||||
using (var cmd = connection.CreateCommand())
|
||||
@ -68,7 +67,7 @@ namespace osu.Game.Database
|
||||
// this is required for the time being due to the way we are querying in places like BeatmapStore.
|
||||
// if we ever move to having consumers file their own .Includes, or get eager loading support, this could be re-enabled.
|
||||
.ConfigureWarnings(warnings => warnings.Ignore(CoreEventId.IncludeIgnoredWarning))
|
||||
.UseSqlite(connectionString)
|
||||
.UseSqlite(connectionString, sqliteOptions => sqliteOptions.CommandTimeout(10))
|
||||
.UseLoggerFactory(logger.Value);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user