Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Wiedler <iwiedler@gitlab.com>2021-01-06 14:47:42 +0300
committerIgor Wiedler <iwiedler@gitlab.com>2021-01-06 14:47:48 +0300
commita3055cd311d892d09194b8dedafeb0aa1297d5e5 (patch)
tree7d42f3876210fd0724dea6cbeb5e8c9dd9086df4
parentca1583d8c8886cebfad74711dcfe9fc4a21d73a1 (diff)
single-line stats extraction nil check
-rw-r--r--internal/middleware/commandstatshandler/commandstatshandler.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/internal/middleware/commandstatshandler/commandstatshandler.go b/internal/middleware/commandstatshandler/commandstatshandler.go
index 13b27e20a..5deb8ac1a 100644
--- a/internal/middleware/commandstatshandler/commandstatshandler.go
+++ b/internal/middleware/commandstatshandler/commandstatshandler.go
@@ -47,8 +47,7 @@ func CommandStatsMessageProducer(ctx context.Context, format string, level logru
entry := ctxlogrus.Extract(ctx).WithContext(ctx).WithFields(fields)
// safely inject commandstats
- stats := command.StatsFromContext(ctx)
- if stats != nil {
+ if stats := command.StatsFromContext(ctx); stats != nil {
entry = entry.WithFields(stats.Fields())
}