mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
Disabled linq2db query cache to see if it helps with out of memory issues
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
using LinqToDB.Common;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using Microsoft.Data.Sqlite;
|
using Microsoft.Data.Sqlite;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
@@ -14,6 +15,7 @@ public class DbService
|
|||||||
public DbService(IBotCredentials creds)
|
public DbService(IBotCredentials creds)
|
||||||
{
|
{
|
||||||
LinqToDBForEFTools.Initialize();
|
LinqToDBForEFTools.Initialize();
|
||||||
|
Configuration.Linq.DisableQueryCache = true;
|
||||||
|
|
||||||
var builder = new SqliteConnectionStringBuilder(creds.Db.ConnectionString);
|
var builder = new SqliteConnectionStringBuilder(creds.Db.ConnectionString);
|
||||||
builder.DataSource = Path.Combine(AppContext.BaseDirectory, builder.DataSource);
|
builder.DataSource = Path.Combine(AppContext.BaseDirectory, builder.DataSource);
|
||||||
|
@@ -5,7 +5,7 @@ using System.Diagnostics;
|
|||||||
|
|
||||||
namespace NadekoBot.Services;
|
namespace NadekoBot.Services;
|
||||||
|
|
||||||
public sealed class StatsService : IStatsService, IReadyExecutor, INService, IDisposable
|
public sealed class StatsService : IStatsService, IReadyExecutor, INService
|
||||||
{
|
{
|
||||||
public const string BOT_VERSION = "4.0.6";
|
public const string BOT_VERSION = "4.0.6";
|
||||||
|
|
||||||
@@ -188,10 +188,4 @@ public sealed class StatsService : IStatsService, IReadyExecutor, INService, IDi
|
|||||||
_currentProcess.Refresh();
|
_currentProcess.Refresh();
|
||||||
return _currentProcess.PrivateMemorySize64 / (double)1.MiB();
|
return _currentProcess.PrivateMemorySize64 / (double)1.MiB();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
_currentProcess.Dispose();
|
|
||||||
GC.SuppressFinalize(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user