Skip to content

Commit 4d9ddc6

Browse files
committed
fix(coderd/batchstats): use debug log on query cancellation in flush
Fixes #9772
1 parent d6089ae commit 4d9ddc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/batchstats/batcher.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ func (b *Batcher) flush(ctx context.Context, forced bool, reason string) {
243243
err = b.store.InsertWorkspaceAgentStats(ctx, *b.buf)
244244
elapsed := time.Since(start)
245245
if err != nil {
246-
if xerrors.Is(err, context.Canceled) {
247-
b.log.Debug(ctx, "context canceled, skipping insert of workspace agent stats", slog.F("elapsed", elapsed))
246+
if database.IsQueryCanceledError(err) {
247+
b.log.Debug(ctx, "query canceled, skipping insert of workspace agent stats", slog.F("elapsed", elapsed))
248248
return
249249
}
250250
b.log.Error(ctx, "error inserting workspace agent stats", slog.Error(err), slog.F("elapsed", elapsed))

0 commit comments

Comments
 (0)