From ad0a9ceb9d7b569d57a4e13f67362a3313d4897a Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 24 Mar 2022 02:46:27 +0100 Subject: [PATCH] Disabled linq2db query cache to see if it helps with out of memory issues --- src/NadekoBot/Services/DbService.cs | 2 ++ src/NadekoBot/Services/Impl/StatsService.cs | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/NadekoBot/Services/DbService.cs b/src/NadekoBot/Services/DbService.cs index d5dbb9e3d..fe581f7dc 100644 --- a/src/NadekoBot/Services/DbService.cs +++ b/src/NadekoBot/Services/DbService.cs @@ -1,4 +1,5 @@ #nullable disable +using LinqToDB.Common; using LinqToDB.EntityFrameworkCore; using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore; @@ -14,6 +15,7 @@ public class DbService public DbService(IBotCredentials creds) { LinqToDBForEFTools.Initialize(); + Configuration.Linq.DisableQueryCache = true; var builder = new SqliteConnectionStringBuilder(creds.Db.ConnectionString); builder.DataSource = Path.Combine(AppContext.BaseDirectory, builder.DataSource); diff --git a/src/NadekoBot/Services/Impl/StatsService.cs b/src/NadekoBot/Services/Impl/StatsService.cs index 7ed354941..957cd2db6 100644 --- a/src/NadekoBot/Services/Impl/StatsService.cs +++ b/src/NadekoBot/Services/Impl/StatsService.cs @@ -5,7 +5,7 @@ using System.Diagnostics; 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"; @@ -188,10 +188,4 @@ public sealed class StatsService : IStatsService, IReadyExecutor, INService, IDi _currentProcess.Refresh(); return _currentProcess.PrivateMemorySize64 / (double)1.MiB(); } - - public void Dispose() - { - _currentProcess.Dispose(); - GC.SuppressFinalize(this); - } }