get rid of recursive call
This commit is contained in:
@@ -43,7 +43,6 @@ var (
|
|||||||
"reva-auth-basic",
|
"reva-auth-basic",
|
||||||
"reva-auth-bearer",
|
"reva-auth-bearer",
|
||||||
"reva-sharing",
|
"reva-sharing",
|
||||||
//"reva-storage-root",
|
|
||||||
"reva-storage-home",
|
"reva-storage-home",
|
||||||
"reva-storage-home-data",
|
"reva-storage-home-data",
|
||||||
"reva-storage-eos",
|
"reva-storage-eos",
|
||||||
@@ -55,6 +54,9 @@ var (
|
|||||||
"konnectd",
|
"konnectd",
|
||||||
"thumbnails",
|
"thumbnails",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Maximum number of retries until getting a connection to the rpc runtime service.
|
||||||
|
maxRetries int = 10
|
||||||
)
|
)
|
||||||
|
|
||||||
// Runtime represents an oCIS runtime environment.
|
// Runtime represents an oCIS runtime environment.
|
||||||
@@ -71,21 +73,30 @@ func (r *Runtime) Start() error {
|
|||||||
return service.Start()
|
return service.Start()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch ocis Extensions
|
// Launch ocis default ocis extensions.
|
||||||
func (r *Runtime) Launch() {
|
func (r *Runtime) Launch() {
|
||||||
client, err := rpc.DialHTTP("tcp", "localhost:10666")
|
var client *rpc.Client
|
||||||
if err != nil {
|
var err error
|
||||||
fmt.Println("rpc service not available, retrying in 1 second...")
|
var try int
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
r.Launch()
|
for {
|
||||||
|
if try >= maxRetries {
|
||||||
|
golog.Fatal("could not get a connection to rpc runtime on localhost:10666")
|
||||||
|
}
|
||||||
|
client, err = rpc.DialHTTP("tcp", "localhost:10666")
|
||||||
|
if err != nil {
|
||||||
|
try++
|
||||||
|
fmt.Println("runtime not available, retrying in 1 second...")
|
||||||
|
time.Sleep(1 * time.Second)
|
||||||
|
} else {
|
||||||
|
goto OUT
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OUT:
|
||||||
all := append(Extensions, MicroServices...)
|
all := append(Extensions, MicroServices...)
|
||||||
for i := range all {
|
for _, v := range all {
|
||||||
arg0 := process.NewProcEntry(
|
arg0 := process.NewProcEntry(v, []string{v}...)
|
||||||
all[i],
|
|
||||||
[]string{all[i]}...,
|
|
||||||
)
|
|
||||||
var arg1 int
|
var arg1 int
|
||||||
|
|
||||||
if err := client.Call("Service.Start", arg0, &arg1); err != nil {
|
if err := client.Call("Service.Start", arg0, &arg1); err != nil {
|
||||||
@@ -99,7 +110,6 @@ func AddMicroPlatform(app *cli.App) {
|
|||||||
setDefaults()
|
setDefaults()
|
||||||
|
|
||||||
app.Commands = append(app.Commands, api.Commands()...)
|
app.Commands = append(app.Commands, api.Commands()...)
|
||||||
app.Commands = append(app.Commands, proxy.Commands()...)
|
|
||||||
app.Commands = append(app.Commands, web.Commands()...)
|
app.Commands = append(app.Commands, web.Commands()...)
|
||||||
app.Commands = append(app.Commands, registry.Commands()...)
|
app.Commands = append(app.Commands, registry.Commands()...)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user