mirror of
https://github.com/datarhei/core.git
synced 2025-10-21 15:09:36 +08:00
Fix update process, list process in raft store
This commit is contained in:
@@ -61,6 +61,8 @@ type Cluster interface {
|
||||
|
||||
Shutdown() error
|
||||
|
||||
ListProcesses() []store.Process
|
||||
GetProcess(id string) (store.Process, error)
|
||||
AddProcess(origin string, config *app.Config) error
|
||||
RemoveProcess(origin, id string) error
|
||||
UpdateProcess(origin, id string, config *app.Config) error
|
||||
@@ -686,6 +688,14 @@ func (c *cluster) trackLeaderChanges() {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *cluster) ListProcesses() []store.Process {
|
||||
return c.store.ProcessList()
|
||||
}
|
||||
|
||||
func (c *cluster) GetProcess(id string) (store.Process, error) {
|
||||
return c.store.GetProcess(id)
|
||||
}
|
||||
|
||||
func (c *cluster) AddProcess(origin string, config *app.Config) error {
|
||||
if !c.IsRaftLeader() {
|
||||
return c.forwarder.AddProcess(origin, config)
|
||||
|
Reference in New Issue
Block a user