From 016aa83016b19ad0a247eead3c60e57748879aa1 Mon Sep 17 00:00:00 2001 From: bouncepaw Date: Sun, 14 Mar 2021 20:20:02 +0500 Subject: [PATCH] Fix a bug related to hypha creation --- hyphae/hyphae.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hyphae/hyphae.go b/hyphae/hyphae.go index 996b65f..aa9e991 100644 --- a/hyphae/hyphae.go +++ b/hyphae/hyphae.go @@ -45,6 +45,10 @@ func storeHypha(h *Hypha) { byNamesMutex.Lock() byNames[h.Name] = h byNamesMutex.Unlock() + + h.Lock() + h.Exists = true + h.Unlock() } // Insert inserts the hypha into the storage. A previous record is used if possible. Count incrementation is done if needed. @@ -101,6 +105,5 @@ func (h *Hypha) MergeIn(oh *Hypha) { } h.BinaryPath = oh.BinaryPath } - h.Exists = oh.Exists h.Unlock() }