clear cached elastic data when sync is done, bug fix
This commit is contained in:
parent
9a450571bd
commit
3f305b104b
|
@ -85,7 +85,7 @@ func syncElasticsearch(doFullSync bool) {
|
|||
return
|
||||
case <-ticker.C:
|
||||
elapsed := time.Since(start)
|
||||
logStr := "ELASTIC - Sync in progress. Elapsed: %d. Busy Elastic delete workers: %d. Elastic deletes queued: %d"
|
||||
logStr := "ELASTIC - Sync in progress. Elapsed: %s. Busy Elastic delete workers: %d. Elastic deletes queued: %d"
|
||||
log.Debugf(logStr, elapsed, globals.ElasticCrawlers.BusyWorkers, globals.ElasticCrawlers.Queue.GetQueueSize())
|
||||
}
|
||||
}
|
||||
|
@ -116,6 +116,12 @@ func syncElasticsearch(doFullSync bool) {
|
|||
globals.ElasticCrawlers.Queue.Terminate()
|
||||
aliveWorkers.Wait()
|
||||
globals.ElasticCrawlers = nil
|
||||
globalPathsByKeyMutex.Lock()
|
||||
globalKeysByPathMutex.Lock()
|
||||
globalKeysByPath = nil
|
||||
globalPathsByKey = nil
|
||||
globalPathsByKeyMutex.Unlock()
|
||||
globalKeysByPathMutex.Unlock()
|
||||
|
||||
duration := time.Since(start)
|
||||
log.Infof("ELASTIC - %s sync finished in %s", syncType, duration)
|
||||
|
|
Loading…
Reference in New Issue