Browse Source

moved mutex

0xdcarns 3 years ago
parent
commit
333a140c74
1 changed files with 2 additions and 2 deletions
  1. 2 2
      logger/logger.go

+ 2 - 2
logger/logger.go

@@ -50,6 +50,8 @@ func Dump() string {
 	if program != "netmaker" {
 	if program != "netmaker" {
 		return ""
 		return ""
 	}
 	}
+	mu.Lock()
+	defer mu.Unlock()
 	var dumpString = ""
 	var dumpString = ""
 	type keyVal struct {
 	type keyVal struct {
 		Key   string
 		Key   string
@@ -118,7 +120,5 @@ func FatalLog(message ...string) {
 
 
 // resetLogs - reallocates logs map
 // resetLogs - reallocates logs map
 func resetLogs() {
 func resetLogs() {
-	mu.Lock()
-	defer mu.Unlock()
 	currentLogs = make(map[string]entry)
 	currentLogs = make(map[string]entry)
 }
 }