3
0

Prevent "context canceled" error for auditlog

This commit is contained in:
Denis Arh
2020-07-13 12:34:10 +02:00
parent e1a91ee09e
commit af874a53d3

View File

@@ -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")
}