Stanislav N. aka pztrn 3cfc74affa
All checks were successful
Linting and tests / Linting (push) Successful in 6s
Client build scripts fixes and server stub with local devzone.
2025-09-13 18:13:50 +05:00

27 lines
441 B
Go

package application
import (
"os"
"os/signal"
"syscall"
)
// ShutdownChan returns shutdown channel for main function.
func (a *Application) ShutdownChan() chan struct{} {
return a.shutdownChan
}
func (a *Application) startServer() {
a.shutdownChan = make(chan struct{})
go func() {
listener := make(chan os.Signal, 1)
signal.Notify(listener, syscall.SIGTERM, os.Interrupt)
<-listener
a.shutdownChan <- struct{}{}
}()
}