Skip to content
Snippets Groups Projects
Unverified Commit bbe187b2 authored by capossele's avatar capossele
Browse files

:fire: Delete finalized conflicts

parent b48b24f3
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,17 @@ func newConflictRecord() *conflictRecord {
}
}
func (cr *conflictRecord) cleanUp() {
cr.lock.Lock()
defer cr.lock.Unlock()
for id, conflict := range cr.conflictSet {
if conflict.isFinalized() {
delete(cr.conflictSet, id)
}
}
}
func (cr *conflictRecord) ToFPCUpdate() *FPCUpdate {
cr.lock.RLock()
defer cr.lock.RUnlock()
......
......@@ -55,10 +55,21 @@ func runFPCLiveFeed() {
fpcLiveFeedWorkerPool.Start()
defer fpcLiveFeedWorkerPool.Stop()
<-shutdownSignal
log.Info("Stopping Analysis[FPCUpdater] ...")
analysis.Events.FPCHeartbeat.Detach(onFPCHeartbeatReceived)
log.Info("Stopping Analysis[FPCUpdater] ... done")
cleanUpTicker := time.NewTicker(1 * time.Minute)
for {
select {
case <-shutdownSignal:
log.Info("Stopping Analysis[FPCUpdater] ...")
analysis.Events.FPCHeartbeat.Detach(onFPCHeartbeatReceived)
cleanUpTicker.Stop()
log.Info("Stopping Analysis[FPCUpdater] ... done")
case <-cleanUpTicker.C:
log.Info("Cleaning up Finalized Conflicts ...")
recordedConflicts.cleanUp()
log.Info("Cleaning up Finalized Conflicts ... done")
}
}
}, shutdown.PriorityDashboard); err != nil {
log.Panicf("Failed to start as daemon: %s", err)
}
......
......@@ -14,7 +14,7 @@ var Plugin = node.NewPlugin(PluginName, node.Enabled, configure, run)
const (
// AppVersion version number
AppVersion = "v0.666.0"
AppVersion = "v0.2.0"
// AppName app code name
AppName = "GoShimmer"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment