You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
545 B
27 lines
545 B
package main
|
|
|
|
import (
|
|
"appNewPlatform/appConstant"
|
|
"appNewPlatform/initialization"
|
|
"fmt"
|
|
"runtime"
|
|
)
|
|
|
|
func main() {
|
|
var Ncpu = runtime.NumCPU()
|
|
fmt.Printf("服务器核心数量:%v\n", Ncpu)
|
|
if Ncpu-1 <= 0 {
|
|
Ncpu = 1
|
|
} else {
|
|
Ncpu = Ncpu - 1
|
|
}
|
|
appConstant.MaxCpuNumber = Ncpu
|
|
fmt.Printf("设置并发服务器核心数量:%v\n", Ncpu)
|
|
runtime.GOMAXPROCS(Ncpu) //设置使用核心数量
|
|
//加载数据库
|
|
initialization.LoadingDatabase()
|
|
//加载Redis
|
|
initialization.LoadRedis()
|
|
//启动App
|
|
initialization.RunItem()
|
|
}
|
|
|