Fix update process, list process in raft store

This commit is contained in:
Ingo Oppermann
2023-05-13 21:21:47 +02:00
parent 29242b96ca
commit 6a4c715f75
10 changed files with 383 additions and 171 deletions

View File

@@ -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)