mirror of
https://github.com/datarhei/core.git
synced 2025-10-06 00:17:07 +08:00
Prevent shadowing processes
This commit is contained in:
@@ -61,7 +61,17 @@ func (h *ClusterHandler) ProcessList(c echo.Context) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
pmap[app.NewProcessID(p.ID, p.Domain)] = p
|
pid := app.NewProcessID(p.ID, p.Domain)
|
||||||
|
proc, ok := pmap[pid]
|
||||||
|
if ok {
|
||||||
|
// While moving a process from one node to another, they exist on both nodes.
|
||||||
|
// This will select the latest incarnation of this process.
|
||||||
|
if p.CreatedAt < proc.CreatedAt {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pmap[pid] = p
|
||||||
}
|
}
|
||||||
|
|
||||||
missing := []api.Process{}
|
missing := []api.Process{}
|
||||||
@@ -76,15 +86,23 @@ func (h *ClusterHandler) ProcessList(c echo.Context) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the process has been deployed
|
// Prevent overshadowing existing processes with undeployed changes.
|
||||||
if len(p.Error) == 0 {
|
// TODO: should undeployed changes be visible in a process config/state? They
|
||||||
if _, ok := pmap[p.Config.ProcessID()]; ok {
|
// are visible in the store process list, however.
|
||||||
continue
|
if _, ok := pmap[p.Config.ProcessID()]; ok {
|
||||||
}
|
continue
|
||||||
} else {
|
|
||||||
delete(pmap, p.Config.ProcessID())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Check if the process has been deployed
|
||||||
|
if len(p.Error) == 0 {
|
||||||
|
if _, ok := pmap[p.Config.ProcessID()]; ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
delete(pmap, p.Config.ProcessID())
|
||||||
|
}
|
||||||
|
*/
|
||||||
process := api.Process{}
|
process := api.Process{}
|
||||||
process.UnmarshalStore(p, filter.config, filter.state, filter.report, filter.metadata)
|
process.UnmarshalStore(p, filter.config, filter.state, filter.report, filter.metadata)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user