From 5204ecf869b3093ea453c444140cf80ed05588f5 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Mon, 25 May 2020 14:24:13 +0200 Subject: [PATCH] delay dependant extensions from running --- pkg/micro/runtime/runtime.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkg/micro/runtime/runtime.go b/pkg/micro/runtime/runtime.go index 6bb841253c..bb084551f1 100644 --- a/pkg/micro/runtime/runtime.go +++ b/pkg/micro/runtime/runtime.go @@ -42,7 +42,6 @@ var ( "reva-users", "reva-auth-basic", "reva-auth-bearer", - "reva-sharing", "reva-storage-home", "reva-storage-home-data", "reva-storage-eos", @@ -55,6 +54,11 @@ var ( "thumbnails", } + // There seem to be a race condition when reva-sharing needs to read the sharing.json file and the parent folder is not present. + dependants = []string{ + "reva-sharing", + } + // Maximum number of retries until getting a connection to the rpc runtime service. maxRetries int = 10 ) @@ -103,6 +107,17 @@ OUT: golog.Fatal(err) } } + + // ugly hack to avoid dependencies. + time.Sleep(2 * time.Second) + for _, v := range dependants { + arg0 := process.NewProcEntry(v, []string{v}...) + var arg1 int + + if err := client.Call("Service.Start", arg0, &arg1); err != nil { + golog.Fatal(err) + } + } } // AddMicroPlatform adds the micro subcommands to the cli app