Move logs about stopping servers to the proper place

This commit is contained in:
Daniel Carrillo 2023-03-20 19:27:17 +01:00
parent 8783db018b
commit b5fa3be506
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16
3 changed files with 3 additions and 3 deletions

View File

@ -44,10 +44,10 @@ func (q *QuicServer) Start() {
log.Fatal(err) log.Fatal(err)
} }
}() }()
log.Printf("Stopping QUIC server...")
} }
func (q *QuicServer) Stop() { func (q *QuicServer) Stop() {
log.Printf("Stopping QUIC server...")
if err := q.server.Close(); err != nil { if err := q.server.Close(); err != nil {
log.Printf("QUIC server forced to shutdown") log.Printf("QUIC server forced to shutdown")
} }

View File

@ -36,10 +36,10 @@ func (t *TCPServer) Start() {
log.Fatal(err) log.Fatal(err)
} }
}() }()
log.Printf("Stopping TCP server...")
} }
func (t *TCPServer) Stop() { func (t *TCPServer) Stop() {
log.Printf("Stopping TCP server...")
if err := t.server.Shutdown(t.ctx); err != nil { if err := t.server.Shutdown(t.ctx); err != nil {
log.Printf("TCP server forced to shutdown: %s", err) log.Printf("TCP server forced to shutdown: %s", err)
} }

View File

@ -37,10 +37,10 @@ func (t *TLSServer) Start() {
log.Fatal(err) log.Fatal(err)
} }
}() }()
log.Printf("Stopping TLS server...")
} }
func (t *TLSServer) Stop() { func (t *TLSServer) Stop() {
log.Printf("Stopping TLS server...")
if err := t.server.Shutdown(t.ctx); err != nil { if err := t.server.Shutdown(t.ctx); err != nil {
log.Printf("TLS server forced to shutdown: %s", err) log.Printf("TLS server forced to shutdown: %s", err)
} }