fix(ci): 修复剩余的CI错误
- 修复 ops_repo_latency_histogram_buckets.go 中另一个函数的 WriteString 未检查错误 - 修复 ops_repo_request_details.go 和 ops_repo_trends.go 中的 Rows.Close 未检查错误 - 修复 ops_alert_models.go, ops_cleanup_service.go, ops_request_details.go 的格式化问题 - 移除 ops_retry.go 中未使用的 status 字段 - 修复 maxTime 函数重复声明(将测试文件中的函数重命名为 testMaxTime)
This commit is contained in:
@@ -72,4 +72,3 @@ type OpsAlertEventFilter struct {
|
||||
Platform string
|
||||
GroupID *int64
|
||||
}
|
||||
|
||||
|
||||
@@ -94,19 +94,19 @@ func (s *OpsCleanupService) Start() {
|
||||
if parsed, err := time.LoadLocation(strings.TrimSpace(s.cfg.Timezone)); err == nil && parsed != nil {
|
||||
loc = parsed
|
||||
}
|
||||
}
|
||||
|
||||
c := cron.New(cron.WithParser(opsCleanupCronParser), cron.WithLocation(loc))
|
||||
_, err := c.AddFunc(schedule, func() { s.runScheduled() })
|
||||
if err != nil {
|
||||
log.Printf("[OpsCleanup] not started (invalid schedule=%q): %v", schedule, err)
|
||||
return
|
||||
}
|
||||
s.cron = c
|
||||
s.cron.Start()
|
||||
log.Printf("[OpsCleanup] started (schedule=%q tz=%s)", schedule, loc.String())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
c := cron.New(cron.WithParser(opsCleanupCronParser), cron.WithLocation(loc))
|
||||
_, err := c.AddFunc(schedule, func() { s.runScheduled() })
|
||||
if err != nil {
|
||||
log.Printf("[OpsCleanup] not started (invalid schedule=%q): %v", schedule, err)
|
||||
return
|
||||
}
|
||||
s.cron = c
|
||||
s.cron.Start()
|
||||
log.Printf("[OpsCleanup] started (schedule=%q tz=%s)", schedule, loc.String())
|
||||
})
|
||||
}
|
||||
|
||||
func (s *OpsCleanupService) Stop() {
|
||||
if s == nil {
|
||||
|
||||
@@ -149,4 +149,3 @@ func (s *OpsService) ListRequestDetails(ctx context.Context, filter *OpsRequestD
|
||||
PageSize: pageSize,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ const (
|
||||
type limitedResponseWriter struct {
|
||||
header http.Header
|
||||
wroteHeader bool
|
||||
status int
|
||||
|
||||
limit int
|
||||
totalWritten int64
|
||||
@@ -65,7 +64,6 @@ func newLimitedResponseWriter(limit int) *limitedResponseWriter {
|
||||
}
|
||||
return &limitedResponseWriter{
|
||||
header: make(http.Header),
|
||||
status: http.StatusOK,
|
||||
limit: limit,
|
||||
}
|
||||
}
|
||||
@@ -79,7 +77,6 @@ func (w *limitedResponseWriter) WriteHeader(statusCode int) {
|
||||
return
|
||||
}
|
||||
w.wroteHeader = true
|
||||
w.status = statusCode
|
||||
}
|
||||
|
||||
func (w *limitedResponseWriter) Write(p []byte) (int, error) {
|
||||
|
||||
Reference in New Issue
Block a user