mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
fix(coderd/batchstats): use debug log on context cancellation in flush (#9777)
This commit is contained in:
committed by
GitHub
parent
7bc98c296b
commit
d6089ae0ad
@ -243,6 +243,10 @@ 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))
|
||||
return
|
||||
}
|
||||
b.log.Error(ctx, "error inserting workspace agent stats", slog.Error(err), slog.F("elapsed", elapsed))
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user