Client build scripts fixes and server stub with local devzone.
All checks were successful
Linting and tests / Linting (push) Successful in 6s
All checks were successful
Linting and tests / Linting (push) Successful in 6s
This commit is contained in:
26
server/internal/application/server.go
Normal file
26
server/internal/application/server.go
Normal file
@@ -0,0 +1,26 @@
|
||||
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{}{}
|
||||
}()
|
||||
}
|
Reference in New Issue
Block a user