Skip to content

Commit 2125c45

Browse files
handle ocis server start in separate routine
1 parent 74de42a commit 2125c45

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/ociswrapper/ocis/ocis.go

+2
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ func RunOcisService(service string) {
285285

286286
cmd = exec.Command(config.Get("bin"), service, "server")
287287

288+
cmd.Env = append(os.Environ(), EnvConfigs...)
289+
288290
logs, err := cmd.StderrPipe()
289291
if err != nil {
290292
log.Panic(err)

tests/ociswrapper/wrapper/handlers/handler.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ func OcisServiceHandler(res http.ResponseWriter, req *http.Request) {
223223
success, _ := ocis.Restart(ocis.EnvConfigs)
224224
if success {
225225
sendResponse(res, http.StatusOK, "oCIS configured successfully")
226-
ocis.RunOcisService(serviceName)
226+
go ocis.RunOcisService(serviceName)
227+
sendResponse(res, http.StatusOK, "oCIS server started successfully")
227228
return
228229
}
229230
sendResponse(res, http.StatusInternalServerError, "Failed to restart oCIS with new configuration")

0 commit comments

Comments
 (0)