From 37fee075db2e012beb6c7a9b57a11d9398e07015 Mon Sep 17 00:00:00 2001 From: wayblink Date: Mon, 9 Oct 2023 16:43:15 +0800 Subject: [PATCH] Alert for port conflicts (#218) Signed-off-by: wayblink --- core/backup_server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/backup_server.go b/core/backup_server.go index c359a242..b402a4bb 100644 --- a/core/backup_server.go +++ b/core/backup_server.go @@ -8,6 +8,7 @@ import ( "github.com/zilliztech/milvus-backup/core/paramtable" "github.com/zilliztech/milvus-backup/core/proto/backuppb" "github.com/zilliztech/milvus-backup/internal/log" + "go.uber.org/zap" "net/http" "net/http/pprof" ) @@ -57,7 +58,11 @@ func (s *Server) Init() { func (s *Server) Start() { s.registerProfilePort() - s.engine.Run(s.config.port) + err := s.engine.Run(s.config.port) + if err != nil { + log.Error("Failed to start server", zap.Error(err)) + panic(err) + } log.Info("Start backup server backend") }