From 3406bbd34469982efeefe164c207dcb5c4a0dac2 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 30 四月 2026 22:03:54 +0800
Subject: [PATCH] fix: 修复多个功能模块中的问题和优化逻辑
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_RedisService/Connection/RedisConnectionManager.cs | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_RedisService/Connection/RedisConnectionManager.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_RedisService/Connection/RedisConnectionManager.cs
index a5e772f..0d93b8b 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_RedisService/Connection/RedisConnectionManager.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_RedisService/Connection/RedisConnectionManager.cs
@@ -3,6 +3,7 @@
using StackExchange.Redis;
using System.Linq;
using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_RedisService.Options;
namespace WIDESEAWCS_RedisService.Connection
@@ -59,16 +60,16 @@
var connection = ConnectionMultiplexer.Connect(configOptions);
connection.ConnectionFailed += (_, e) =>
- ConsoleHelper.WriteErrorLine($"Redis杩炴帴澶辫触: {e.FailureType}");
+ QuartzLogger.Info($"Redis杩炴帴澶辫触: {e.FailureType}");
connection.ConnectionRestored += (_, e) =>
- ConsoleHelper.WriteSuccessLine($"Redis杩炴帴鎭㈠: {e.EndPoint}");
+ QuartzLogger.Info($"Redis杩炴帴鎭㈠: {e.EndPoint}");
- ConsoleHelper.WriteSuccessLine($"Redis杩炴帴鎴愬姛: {string.Join(",", configOptions.EndPoints)}");
+ QuartzLogger.Info($"Redis杩炴帴鎴愬姛: {string.Join(",", configOptions.EndPoints)}");
return connection;
}
catch (Exception ex)
{
- ConsoleHelper.WriteErrorLine($"Redis杩炴帴鍒涘缓澶辫触:{ex.Message}");
+ QuartzLogger.Error($"Redis杩炴帴鍒涘缓澶辫触:{ex.Message}",null, ex);
throw;
}
}
@@ -81,6 +82,8 @@
public IServer GetServer()
{
var endpoints = _connection.Value.GetEndPoints();
+ if (endpoints == null || endpoints.Length == 0)
+ throw new InvalidOperationException("Redis娌℃湁鍙敤鐨勭粓缁撶偣锛岃妫�鏌ヨ繛鎺ラ厤缃�");
return _connection.Value.GetServer(endpoints[0]);
}
--
Gitblit v1.9.3