mirror of
https://github.com/datarhei/core.git
synced 2025-10-06 00:17:07 +08:00
Retrieve current process from leader, clone metadata, introduce new state 'deploying'
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user