Run server that terminates on SIGINT, SIGTERM signals
()
| 96 | |
| 97 | // Run server that terminates on SIGINT, SIGTERM signals |
| 98 | func (s *Server) Run() { |
| 99 | ctx, cancel := signal.NotifyContext( |
| 100 | context.Background(), syscall.SIGINT, syscall.SIGTERM) |
| 101 | defer cancel() |
| 102 | s.RunContext(ctx) |
| 103 | } |
| 104 | |
| 105 | // RunContext run server with context |
| 106 | func (s *Server) RunContext(ctx context.Context) { |