优化抖动幅度和日志双时间显示
- jitterDuration 抖动从 base/3 降至 base/10,避免过大的随机延迟 - 日志新增斗鱼双时间显示:本地时间后追加 (D斗鱼时间),前端蓝色高亮 - 时间校准后自动同步斗鱼偏移量到日志模块
This commit is contained in:
@@ -86,8 +86,9 @@ func (a *App) startup(ctx context.Context) {
|
||||
logger.LogEvent("图片", "warn", "成功图片目录创建失败,图片保存功能可能不可用: %v", err)
|
||||
}
|
||||
|
||||
if serverTime, err := a.client.ServerTime(); err == nil {
|
||||
logger.LogEvent("时间", "success", "服务端时间获取成功: %s", serverTime.In(constants.CST).Format("2006-01-02 15:04:05.000"))
|
||||
if sample, err := a.client.ServerTimeSample(); err == nil {
|
||||
logger.SetDouyuOffset(sample.Offset)
|
||||
logger.LogEvent("时间", "success", "服务端时间获取成功: %s", sample.EstimatedServerNow().In(constants.CST).Format("2006-01-02 15:04:05.000"))
|
||||
} else {
|
||||
logger.LogEvent("时间", "error", "服务端时间获取失败: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user