mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 05:20:26 +00:00
Fix hyphae count corruption on reindexation
This commit is contained in:
parent
100f5ada92
commit
455a3e0f79
@ -10,6 +10,13 @@ var count = struct {
|
|||||||
sync.Mutex
|
sync.Mutex
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
|
// Set the value of hyphae count to zero.
|
||||||
|
func ResetCount() {
|
||||||
|
count.Lock()
|
||||||
|
count.value = 0
|
||||||
|
count.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
// Increment the value of hyphae count.
|
// Increment the value of hyphae count.
|
||||||
func IncrementCount() {
|
func IncrementCount() {
|
||||||
count.Lock()
|
count.Lock()
|
||||||
|
1
main.go
1
main.go
@ -70,6 +70,7 @@ func handlerReindex(w http.ResponseWriter, rq *http.Request) {
|
|||||||
log.Println("Rejected", rq.URL)
|
log.Println("Rejected", rq.URL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
hyphae.ResetCount()
|
||||||
HyphaStorage = make(map[string]*HyphaData)
|
HyphaStorage = make(map[string]*HyphaData)
|
||||||
log.Println("Wiki storage directory is", WikiDir)
|
log.Println("Wiki storage directory is", WikiDir)
|
||||||
log.Println("Start indexing hyphae...")
|
log.Println("Start indexing hyphae...")
|
||||||
|
Loading…
Reference in New Issue
Block a user