add project

This commit is contained in:
GuilhermeStrice
2025-07-09 19:31:34 +01:00
parent 8d2e88edf4
commit f37078157d
44 changed files with 7680 additions and 0 deletions

View File

@ -0,0 +1,31 @@
using System;
using StackExchange.Redis;
using System.Threading.Tasks;
using RedisManager;
using RedisManager.Utils;
namespace RedisManager
{
public static class CustomConfigApplier
{
public static async Task ApplyCustomConfigAsync(InstanceConfig instance)
{
if (instance?.CustomConfig == null || instance.CustomConfig.Count == 0)
return;
try
{
var mux = RedisUtils.ConnectRedis(instance);
var db = mux.GetDatabase();
foreach (var kv in instance.CustomConfig)
{
db.Execute("CONFIG", "SET", kv.Key, kv.Value);
}
mux.Dispose();
}
catch (Exception ex)
{
Console.WriteLine($"[Daemon] Warning: Failed to apply custom config for instance '{instance.Name}': {ex.Message}");
}
}
}
}