Added query cache entry count and capacity to front-end, Fixed ServerGetStatsResult field naming
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user