From af874a53d3554ddbf4d86b39e505f262092250bb Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Mon, 13 Jul 2020 12:34:10 +0200 Subject: [PATCH] Prevent "context canceled" error for auditlog --- pkg/actionlog/service.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/actionlog/service.go b/pkg/actionlog/service.go index 5fd025aac..e13e16f18 100644 --- a/pkg/actionlog/service.go +++ b/pkg/actionlog/service.go @@ -72,6 +72,11 @@ func (svc service) Record(ctx context.Context, l loggable) { return } + // We want to prevent any abrupt cancelation + // (eg canceled request) that would cause + // auditlog to fail... + ctx = context.Background() + if err := svc.repo.Record(ctx, a); err != nil { svc.logger.With(zap.Error(err)).Error("could not record audit event") }