chore: ci文件补充
This commit is contained in:
31
app/services/sales-api/main.go
Normal file
31
app/services/sales-api/main.go
Normal 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")
|
||||
}
|
||||
Reference in New Issue
Block a user