mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
90d471b133
Signed-off-by: XuanYang-cn <xuan.yang@zilliz.com>
41 lines
615 B
Go
41 lines
615 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
|
|
distributed "github.com/zilliztech/milvus-distributed/cmd/distributed/components"
|
|
)
|
|
|
|
func main() {
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
defer cancel()
|
|
|
|
svr, err := distributed.NewQueryNode(ctx)
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
if err = svr.Run(); err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
sc := make(chan os.Signal, 1)
|
|
signal.Notify(sc,
|
|
syscall.SIGHUP,
|
|
syscall.SIGINT,
|
|
syscall.SIGTERM,
|
|
syscall.SIGQUIT)
|
|
|
|
sig := <-sc
|
|
log.Print("Got signal to exit", sig.String())
|
|
|
|
if err := svr.Stop(); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|