Skip to content

Commit d6089ae

Browse files
authored
fix(coderd/batchstats): use debug log on context cancellation in flush (#9777)
1 parent 7bc98c2 commit d6089ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coderd/batchstats/batcher.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ 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))
248+
return
249+
}
246250
b.log.Error(ctx, "error inserting workspace agent stats", slog.Error(err), slog.F("elapsed", elapsed))
247251
return
248252
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy