移除无用的价格Clamp检测,仅保留8位小数截断

This commit is contained in:
claw_bot 2026-03-12 06:26:57 +00:00
parent e7a551ea8b
commit 447eb9ef4f

View File

@ -342,14 +342,14 @@ public class MarketDataService : IMarketDataService
source = "Tiingo";
}
// 写入缓存保留8位小数强制转换为12位整数+8位小数避免MySql字段溢出
// 写入缓存保留8位小数
var cacheEntity = new MarketPriceCache
{
Id = cacheKey,
Symbol = symbol.ToUpper(),
AssetType = assetType.ToUpper(),
Price = Math.Round(Math.Clamp(response.Price, 0, 999999999999.99999999m), 8),
PreviousClose = response.PreviousClose > 0 ? Math.Round(Math.Clamp(response.PreviousClose.Value, 0, 999999999999.99999999m), 8) : null,
Price = Math.Round(response.Price, 8),
PreviousClose = response.PreviousClose > 0 ? Math.Round(response.PreviousClose.Value, 8) : null,
Source = source,
FetchedAt = DateTime.Now,
ExpiredAt = GetCacheExpirationTime(assetType)