Added query cache entry count and capacity to front-end, Fixed ServerGetStatsResult field naming

This commit is contained in:
2026-01-07 01:15:55 +01:00
parent c09514c657
commit e83ce61877
8 changed files with 155 additions and 27 deletions

View File

@@ -1,6 +1,7 @@
using System.Configuration;
using System.Data.Common;
using System.Text;
using System.Text.Json;
using MySql.Data.MySqlClient;
using Server.Exceptions;
using Server.Models;
@@ -244,4 +245,22 @@ public class DatabaseHelper(ILogger<DatabaseHelper> logger)
searchdomainSumReader.Close();
return result;
}
public static SearchdomainSettings GetSearchdomainSettings(SQLHelper helper, string searchdomain)
{
Dictionary<string, dynamic> parameters = new()
{
["name"] = searchdomain
};
DbDataReader reader = helper.ExecuteSQLCommand("SELECT settings from searchdomain WHERE name = @name", parameters);
try
{
reader.Read();
string settingsString = reader.GetString(0);
return JsonSerializer.Deserialize<SearchdomainSettings>(settingsString);
} finally
{
reader.Close();
}
}
}