mirror of
https://github.com/postmannen/ctrl.git
synced 2025-03-05 06:46:48 +00:00
Activating timed exit
This commit is contained in:
parent
410f3ff717
commit
7002ca4364
1 changed files with 3 additions and 3 deletions
|
@ -288,8 +288,8 @@ func (s *server) Start() {
|
||||||
|
|
||||||
// Adding a safety function here so we can make sure that all processes
|
// 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.
|
// are stopped after a given time if the context cancelation below hangs.
|
||||||
func() {
|
go func() {
|
||||||
time.Sleep(time.Second * 0)
|
time.Sleep(time.Second * 5)
|
||||||
log.Printf("error: doing a non graceful shutdown of all processes..\n")
|
log.Printf("error: doing a non graceful shutdown of all processes..\n")
|
||||||
os.Exit(1)
|
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
|
// the state if the messages received have been processed or not, so it is not
|
||||||
// deeply needed to implement this.
|
// deeply needed to implement this.
|
||||||
// But still.. Need to look into this.
|
// But still.. Need to look into this.
|
||||||
time.Sleep(time.Second * 10)
|
//time.Sleep(time.Second * 10)
|
||||||
s.ctxCancelFunc()
|
s.ctxCancelFunc()
|
||||||
fmt.Printf(" *** Done: ctxCancelFunc()\n")
|
fmt.Printf(" *** Done: ctxCancelFunc()\n")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue