google / exposure-notifications-server

Exposure Notification Reference Server | Covid-19 Exposure Notifications
https://www.google.com/covid19/exposurenotifications/
Apache License 2.0
2.43k stars 311 forks source link

Server graceful shutdown sync #1546

Closed alextur closed 3 years ago

alextur commented 3 years ago

ServeHTTP() function requires some synchronization between shutdown routine and the main one. Otherwise it simply doesn't wait for the actual server's shutdown and returns from the function.

https://github.com/google/exposure-notifications-server/blob/b6dc1aeb17b456e04d15f216fb05f8b8bccd0225/pkg/server/server.go#L120