mirror of
https://github.com/versity/versitygw.git
synced 2026-09-20 15:04:27 +00:00
feat: gracul shutdown of s3api and admin servers
Implements graceful shutdown for the admin and s3api servers. They are shut down before other components (IAM, s3logger, etc.) to allow the servers to properly handle any pending requests while dependencies are still active. The shutdown process is controlled by a context with a 10-second timeout. If it exceeds this duration, all remaining requests are forcefully terminated and the servers are closed.
This commit is contained in:
@@ -100,3 +100,8 @@ func (sa *S3AdminServer) Serve() (err error) {
|
||||
}
|
||||
return sa.app.Listen(sa.port)
|
||||
}
|
||||
|
||||
// ShutDown gracefully shuts down the server with a context timeout
|
||||
func (sa S3AdminServer) Shutdown() error {
|
||||
return sa.app.ShutdownWithTimeout(shutDownDuration)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user