fix:解决标的债券期限缓存不一致的问题

This commit is contained in:
张名锐
2026-06-09 16:17:48 +08:00
parent 68cafde942
commit b8358a7198
2 changed files with 22 additions and 0 deletions
@@ -194,6 +194,27 @@ namespace YLErp.Modules.UnderlyingModule
}
}
/// <summary>
/// 清除指定标的的保证金率缓存
/// </summary>
/// <param name="underlyingCode">标的代码,为空时清除全部</param>
public static void ClearMarginRateCache(string underlyingCode = null)
{
try
{
if (ylCache == null) return;
var cachePattern = string.IsNullOrEmpty(underlyingCode)
? "ClientMarginRate:*"
: $"ClientMarginRate:*:{underlyingCode}:*";
ylCache.BatchDelete(cachePattern);
}
catch (Exception ex)
{
LogFactory.GetLogger("UnderlyingHelper").Error($"清除保证金率缓存时发生异常: {ex.Message}", ex);
}
}
/// <summary>
/// 获取篮子标的品种对象
/// </summary>