MCPcopy Index your code
hub / github.com/coder/coder / shutdownBatch

Method shutdownBatch

enterprise/coderd/connectionlog/connectionlog.go:500–509  ·  view source on GitHub ↗

shutdownBatch makes a single write attempt during shutdown with a bounded timeout so it can't hang indefinitely.

(params database.BatchUpsertConnectionLogsParams)

Source from the content-addressed store, hash-verified

498// shutdownBatch makes a single write attempt during shutdown with a
499// bounded timeout so it can't hang indefinitely.
500func (b *DBBatcher) shutdownBatch(params database.BatchUpsertConnectionLogsParams) {
501 ctx, cancel := context.WithTimeout(context.Background(), shutdownWriteTimeout)
502 defer cancel()
503 //nolint:gocritic // System-level batch operation for connection logs.
504 err := b.store.BatchUpsertConnectionLogs(dbauthz.AsConnectionLogger(ctx), params)
505 if err != nil {
506 b.log.Error(b.ctx, "batch write failed on shutdown, dropping batch",
507 slog.Error(err), slog.F("dropped", len(params.ID)))
508 }
509}
510
511type connectionSlogBackend struct {
512 exporter *auditbackends.SlogExporter

Callers 2

runMethod · 0.95
retryBatchMethod · 0.95

Calls 3

AsConnectionLoggerFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected