chore: ci文件补充

This commit is contained in:
2022-01-15 18:36:37 +08:00
parent 141bd031d4
commit fcfc0ac688
10 changed files with 49 additions and 37 deletions

View File

@@ -0,0 +1,31 @@
package main
import (
"go.uber.org/automaxprocs/maxprocs"
"log"
"os"
"os/signal"
"runtime"
"syscall"
)
var build = "develop"
func main() {
// Set the correct number of threads for the service
// based on what is available either by the machine or quoras.
if _, err := maxprocs.Set(); err != nil {
log.Println(err)
return
}
g := runtime.GOMAXPROCS(0)
log.Printf("starting service build[%s] CPU[%d]", build, g)
defer log.Println("service ended")
shutdown := make(chan os.Signal, 1)
signal.Notify(shutdown, syscall.SIGINT, syscall.SIGTERM)
<-shutdown
log.Println("stopping service")
}