mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: stop logging error on canceled query (#11506)
Fixes flake seen here: https://github.com/coder/coder/actions/runs/7447779208/job/20260756050
This commit is contained in:
@ -242,10 +242,8 @@ func (s *server) heartbeatLoop() {
|
||||
}
|
||||
start := s.timeNow()
|
||||
hbCtx, hbCancel := context.WithTimeout(s.lifecycleCtx, s.heartbeatInterval)
|
||||
if err := s.heartbeat(hbCtx); err != nil {
|
||||
if !xerrors.Is(err, context.DeadlineExceeded) && !xerrors.Is(err, context.Canceled) {
|
||||
s.Logger.Error(hbCtx, "heartbeat failed", slog.Error(err))
|
||||
}
|
||||
if err := s.heartbeat(hbCtx); err != nil && !database.IsQueryCanceledError(err) {
|
||||
s.Logger.Error(hbCtx, "heartbeat failed", slog.Error(err))
|
||||
}
|
||||
hbCancel()
|
||||
elapsed := s.timeNow().Sub(start)
|
||||
|
Reference in New Issue
Block a user