You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/04/19 15:09:11 UTC

[GitHub] [apisix-dashboard] starsz commented on a change in pull request #1667: feat: run manager-api as a systemd daemon/service

starsz commented on a change in pull request #1667:
URL: https://github.com/apache/apisix-dashboard/pull/1667#discussion_r615929664



##########
File path: api/cmd/managerapi.go
##########
@@ -69,85 +69,102 @@ func NewManagerAPICommand() *cobra.Command {
 				os.Exit(0)
 			}
 
-			conf.InitConf()
-			log.InitLogger()
-
-			if err := utils.WritePID(conf.PIDPath); err != nil {
-				log.Errorf("failed to write pid: %s", err)
-				panic(err)
-			}
-			utils.AppendToClosers(func() error {
-				if err := os.Remove(conf.PIDPath); err != nil {
-					log.Errorf("failed to remove pid path: %s", err)
-					return err
-				}
-				return nil
-			})
-
-			droplet.Option.Orchestrator = func(mws []droplet.Middleware) []droplet.Middleware {
-				var newMws []droplet.Middleware
-				// default middleware order: resp_reshape, auto_input, traffic_log
-				// We should put err_transform at second to catch all error
-				newMws = append(newMws, mws[0], &handler.ErrorTransformMiddleware{}, &filter.AuthenticationMiddleware{})
-				newMws = append(newMws, mws[1:]...)
-				return newMws
+			service, err := createService()
+			if err != nil {
+				return err
 			}
+			status, err := service.manageService()
+			fmt.Printf("%s\n", status)

Review comment:
       Debug info ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org