Retrieve current process from leader, clone metadata, introduce new state 'deploying'

This commit is contained in:
Ingo Oppermann
2024-07-22 16:58:57 +02:00
parent 9e52f19a66
commit 879819f10f
19 changed files with 282 additions and 192 deletions

View File

@@ -2,6 +2,7 @@ package forwarder
import (
apiclient "github.com/datarhei/core/v16/cluster/client"
"github.com/datarhei/core/v16/cluster/store"
"github.com/datarhei/core/v16/restream/app"
)
@@ -21,6 +22,20 @@ func (f *Forwarder) ProcessAdd(origin string, config *app.Config) error {
return reconstructError(client.ProcessAdd(origin, r))
}
func (f *Forwarder) ProcessGet(origin string, id app.ProcessID) (store.Process, string, error) {
if origin == "" {
origin = f.ID
}
f.lock.RLock()
client := f.client
f.lock.RUnlock()
process, nodeid, err := client.ProcessGet(origin, id)
return process, nodeid, reconstructError(err)
}
func (f *Forwarder) ProcessUpdate(origin string, id app.ProcessID, config *app.Config) error {
if origin == "" {
origin = f.ID