add pulsar client

This commit is contained in:
w1ndyb0y
2021-02-01 15:35:13 +08:00
parent 9a14fb2cef
commit 3ad4c76acd
8 changed files with 246 additions and 5 deletions
+9 -2
View File
@@ -72,7 +72,12 @@ func start() {
sig := <-sigs
logger.Info("got ", zap.Any("signal", sig))
utils.ServerRunning = false
utils.StopSocketServer()
if tcp {
utils.StopSocketServer()
}
if pulsar {
utils.ClosePulsar()
}
done <- true
}()
@@ -81,7 +86,9 @@ func start() {
// above sending a value on `done`) and then exit.
logger.Info("awaiting signal")
_ = utils.InitDb(dbFile, dbInit)
go utils.Listen(socketAddress)
if tcp {
go utils.Listen(socketAddress)
}
for utils.ServerRunning {
if !utils.IsPortOpen() {
logger.Info("try to open port")