Add run time cpu count.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-12-16 22:43:55 +08:00
parent 866195d9a5
commit dfe8929e46
1 changed files with 5 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"log" "log"
"os" "os"
"runtime"
"strconv" "strconv"
"github.com/appleboy/gorush/config" "github.com/appleboy/gorush/config"
@ -82,6 +83,10 @@ func createPIDFile() error {
return nil return nil
} }
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
}
func main() { func main() {
opts := config.ConfYaml{} opts := config.ConfYaml{}