From 0896f753d688f12348947c833dadeb932ee8c733 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Sat, 25 May 2024 16:07:45 +0930 Subject: [PATCH] cmd/watcher: move detailer and timezone fields to be more informative They are both protected by pMu, so should be in the pMu block. --- cmd/watcher/main.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cmd/watcher/main.go b/cmd/watcher/main.go index afa55c1..44de9d1 100644 --- a/cmd/watcher/main.go +++ b/cmd/watcher/main.go @@ -166,20 +166,18 @@ type daemon struct { // conn is the connection to the kernel. conn *jsonrpc2.Connection - detailer detailer - - timezone current - ctx context.Context log *slog.Logger level *slog.LevelVar addSource *atomic.Bool cancel context.CancelFunc - pMu sync.Mutex - polling time.Duration - pStop chan struct{} - rules atomic.Value // map[string]cel.Program + pMu sync.Mutex + polling time.Duration + timezone current + detailer detailer + pStop chan struct{} + rules atomic.Value // map[string]cel.Program hMu sync.Mutex heartbeat time.Duration