From 803c5d7912b4a0ca902643985a906b18784c8ab9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 11 Mar 2024 20:09:47 +0800 Subject: [PATCH] 1 --- app.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.go b/app.go index 657c949..c7a17f4 100644 --- a/app.go +++ b/app.go @@ -49,6 +49,7 @@ type UserApp interface { } type app struct { + pid int zoneId int32 nodeId int32 instanceId int32 @@ -82,6 +83,7 @@ type app struct { func (this *app) init(userApp UserApp) { this.userApp = userApp this.nowTime = time.Now() + this.pid = os.Getpid() this.ormDbHash = make(map[string]*gorm.DB) this.SetTimeOffset(0) atomic.StoreInt64(&this.nowUnixNano, this.nowTime.UnixNano()) @@ -118,7 +120,7 @@ func (this *app) init(userApp UserApp) { GetSysLog().Info("node_id:%d instance_id:%d pid:%d", this.nodeId, this.instanceId, - os.Getpid()) + this.pid) this.installTimer() go this.goLoopTimer() this.ginEngine = gin.New() @@ -374,7 +376,7 @@ func (this *app) getCaHandle(handleName string) GinHandlerFunc { } func (this *app) GetPid() int { - return os.Getpid() + return this.pid } func parseArgs() (int, int) {