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) {