From 333a140c7414c4cd7514e29b569a62b520b1641d Mon Sep 17 00:00:00 2001 From: 0xdcarns Date: Wed, 25 May 2022 12:46:57 -0400 Subject: [PATCH] moved mutex --- logger/logger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logger/logger.go b/logger/logger.go index 72eed3e8..6700c48b 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -50,6 +50,8 @@ func Dump() string { if program != "netmaker" { return "" } + mu.Lock() + defer mu.Unlock() var dumpString = "" type keyVal struct { Key string @@ -118,7 +120,5 @@ func FatalLog(message ...string) { // resetLogs - reallocates logs map func resetLogs() { - mu.Lock() - defer mu.Unlock() currentLogs = make(map[string]entry) }