1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

Activating timed exit

This commit is contained in:
postmannen 2021-08-03 12:30:18 +02:00
parent 410f3ff717
commit 7002ca4364

View file

@ -288,8 +288,8 @@ func (s *server) Start() {
// Adding a safety function here so we can make sure that all processes
// are stopped after a given time if the context cancelation below hangs.
func() {
time.Sleep(time.Second * 0)
go func() {
time.Sleep(time.Second * 5)
log.Printf("error: doing a non graceful shutdown of all processes..\n")
os.Exit(1)
}()
@ -302,7 +302,7 @@ func (s *server) Start() {
// the state if the messages received have been processed or not, so it is not
// deeply needed to implement this.
// But still.. Need to look into this.
time.Sleep(time.Second * 10)
//time.Sleep(time.Second * 10)
s.ctxCancelFunc()
fmt.Printf(" *** Done: ctxCancelFunc()\n")