mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
fix(coderd/batchstats): use debug log on query cancellation in flush (#9778)
Fixes #9772
This commit is contained in:
committed by
GitHub
parent
ceb52ac24a
commit
161a3cfa26
@ -243,8 +243,8 @@ func (b *Batcher) flush(ctx context.Context, forced bool, reason string) {
|
||||
err = b.store.InsertWorkspaceAgentStats(ctx, *b.buf)
|
||||
elapsed := time.Since(start)
|
||||
if err != nil {
|
||||
if xerrors.Is(err, context.Canceled) {
|
||||
b.log.Debug(ctx, "context canceled, skipping insert of workspace agent stats", slog.F("elapsed", elapsed))
|
||||
if database.IsQueryCanceledError(err) {
|
||||
b.log.Debug(ctx, "query canceled, skipping insert of workspace agent stats", slog.F("elapsed", elapsed))
|
||||
return
|
||||
}
|
||||
b.log.Error(ctx, "error inserting workspace agent stats", slog.Error(err), slog.F("elapsed", elapsed))
|
||||
|
Reference in New Issue
Block a user