Skip to content

Commit

Permalink
handle ocis server start in separate routine
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha committed Dec 18, 2024
1 parent 74de42a commit 2125c45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/ociswrapper/ocis/ocis.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ func RunOcisService(service string) {

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

cmd.Env = append(os.Environ(), EnvConfigs...)

logs, err := cmd.StderrPipe()
if err != nil {
log.Panic(err)
Expand Down
3 changes: 2 additions & 1 deletion tests/ociswrapper/wrapper/handlers/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ func OcisServiceHandler(res http.ResponseWriter, req *http.Request) {
success, _ := ocis.Restart(ocis.EnvConfigs)
if success {
sendResponse(res, http.StatusOK, "oCIS configured successfully")
ocis.RunOcisService(serviceName)
go ocis.RunOcisService(serviceName)
sendResponse(res, http.StatusOK, "oCIS server started successfully")
return
}
sendResponse(res, http.StatusInternalServerError, "Failed to restart oCIS with new configuration")
Expand Down

0 comments on commit 2125c45

Please sign in to comment.