fix: stop logging error on query canceled (#12017)

Fixes flake seen here: https://github.com/coder/coder/actions/runs/7782340530/job/21218566449
This commit is contained in:
Spike Curtis 2024-02-06 08:43:34 +04:00 committed by GitHub
parent b73e66e9a9
commit c84a637116
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -473,7 +473,9 @@ func (m *agentConnectionMonitor) monitor(ctx context.Context) {
err = m.updateConnectionTimes(ctx)
if err != nil {
reason = err.Error()
m.logger.Error(ctx, "failed to update agent connection times", slog.Error(err))
if !database.IsQueryCanceledError(err) {
m.logger.Error(ctx, "failed to update agent connection times", slog.Error(err))
}
return
}
if connectionStatusChanged {