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:
niksis02
2025-10-10 22:10:56 +04:00
parent e2534afafe
commit 64f50cc504
3 changed files with 29 additions and 12 deletions
+5
View File
@@ -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)
}