mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +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)
|
err = b.store.InsertWorkspaceAgentStats(ctx, *b.buf)
|
||||||
elapsed := time.Since(start)
|
elapsed := time.Since(start)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if xerrors.Is(err, context.Canceled) {
|
if database.IsQueryCanceledError(err) {
|
||||||
b.log.Debug(ctx, "context canceled, skipping insert of workspace agent stats", slog.F("elapsed", elapsed))
|
b.log.Debug(ctx, "query canceled, skipping insert of workspace agent stats", slog.F("elapsed", elapsed))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
b.log.Error(ctx, "error inserting workspace agent stats", slog.Error(err), slog.F("elapsed", elapsed))
|
b.log.Error(ctx, "error inserting workspace agent stats", slog.Error(err), slog.F("elapsed", elapsed))
|
||||||
|
Reference in New Issue
Block a user