fix: Rock Token 超时按满 2/3 天判定并统一显示口径
This commit is contained in:
@@ -55,10 +55,11 @@ func (s *RockService) ListDeletedRockTokens(ctx context.Context, page, pageSize
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
warnDays, _, boundWarnDays := rockOverdueThresholds(cfg)
|
||||
warnDays, dangerDays, boundWarnDays := rockOverdueThresholds(cfg)
|
||||
now := time.Now()
|
||||
db := applyRockTokenListFilters(
|
||||
s.db.WithContext(ctx).Unscoped().Model(&model.RockToken{}).Where("deleted_at IS NOT NULL"),
|
||||
status, search, time.Now(), warnDays, boundWarnDays,
|
||||
status, search, now, warnDays, boundWarnDays,
|
||||
)
|
||||
|
||||
var total int64
|
||||
@@ -79,6 +80,7 @@ func (s *RockService) ListDeletedRockTokens(ctx context.Context, page, pageSize
|
||||
tokens[i].DeletedAtText = tokens[i].DeletedAt.Time.Format(time.RFC3339)
|
||||
}
|
||||
}
|
||||
applyRockTokenOverdueFlags(tokens, now, warnDays, dangerDays, boundWarnDays)
|
||||
return tokens, total, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user