This commit is contained in:
aozhiwei 2024-11-06 15:29:38 +08:00
parent 37a99c4226
commit 3163678bc0
2 changed files with 8 additions and 0 deletions

3
app.go
View File

@ -109,6 +109,8 @@ func (this *app) init(userApp UserApp) {
_jsStyleDb.init(JS_STYLE_DB) _jsStyleDb.init(JS_STYLE_DB)
_httpCliMgr = new(httpCliMgr) _httpCliMgr = new(httpCliMgr)
_httpCliMgr.init() _httpCliMgr.init()
_msgQueue = new(msgQueue)
_msgQueue.init()
{ {
tmpNodeId, tmpInstanceId := parseArgs() tmpNodeId, tmpInstanceId := parseArgs()
this.nodeId = int32(tmpNodeId) this.nodeId = int32(tmpNodeId)
@ -163,6 +165,7 @@ func (this *app) init(userApp UserApp) {
func (this *app) unInit() { func (this *app) unInit() {
this.chGoLoopTimerExit <- 1 this.chGoLoopTimerExit <- 1
_msgQueue.unInit()
_httpCliMgr.unInit() _httpCliMgr.unInit()
_goStyleDb.unInit() _goStyleDb.unInit()
_jsStyleDb.unInit() _jsStyleDb.unInit()

View File

@ -8,6 +8,7 @@ var _httpCliMgr *httpCliMgr
var _dbFilter *dbFilter var _dbFilter *dbFilter
var _goStyleDb *goDbPool var _goStyleDb *goDbPool
var _jsStyleDb *dbPool var _jsStyleDb *dbPool
var _msgQueue *msgQueue
func GetApp() App { func GetApp() App {
return _app return _app
@ -41,6 +42,10 @@ func GetJsStyleDb() *dbPool {
return _jsStyleDb return _jsStyleDb
} }
func GetMsgQueue() *msgQueue {
return _msgQueue
}
func Run(userApp UserApp) { func Run(userApp UserApp) {
_app = new(app) _app = new(app)
_app.init(userApp) _app.init(userApp)