37 lines
760 B
Go
37 lines
760 B
Go
|
// OSGOS shop client
|
||
|
// =======================================================================================================
|
||
|
// Author: LLC Texnico <main@texnico.ru>
|
||
|
// All rights reserved
|
||
|
// Russia, Chelyabinsk, 2022-2024
|
||
|
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
log "github.com/sirupsen/logrus"
|
||
|
"os"
|
||
|
"os/signal"
|
||
|
"shop-client/services"
|
||
|
"shop-client/services/web"
|
||
|
"syscall"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
interrupt := make(chan os.Signal, 1)
|
||
|
signal.Notify(interrupt, os.Interrupt, syscall.SIGTERM)
|
||
|
|
||
|
go web.Thread()
|
||
|
go services.HelperService()
|
||
|
|
||
|
switch <-interrupt {
|
||
|
case os.Interrupt:
|
||
|
log.Info("got SIGINT...")
|
||
|
case os.Kill:
|
||
|
log.Info("got SIGKILL...")
|
||
|
case syscall.SIGTERM:
|
||
|
log.Info("got SIGTERM...")
|
||
|
}
|
||
|
|
||
|
services.Stop()
|
||
|
log.Info("закончили работу")
|
||
|
}
|