mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2025-12-31 08:44:25 +00:00
Merge pull request #8 from bitechdev/copilot/sub-pr-5
Fix impossible type assertion in Remove method
This commit is contained in:
@@ -220,8 +220,8 @@ func (sm *serverManager) Remove(name string) error {
|
||||
// Stop the server if it's running. Prefer the server's configured shutdownTimeout
|
||||
// when available, and fall back to a sensible default.
|
||||
timeout := 10 * time.Second
|
||||
if gs, ok := instance.(*gracefulServer); ok && gs.shutdownTimeout > 0 {
|
||||
timeout = gs.shutdownTimeout
|
||||
if si, ok := instance.(*serverInstance); ok && si.gracefulServer != nil && si.gracefulServer.shutdownTimeout > 0 {
|
||||
timeout = si.gracefulServer.shutdownTimeout
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
|
||||
Reference in New Issue
Block a user