Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/cli/gateway_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

const (
defaultGatewayLogLevel = "info"
defaultGatewayIdleShutdownDelay = 30 * time.Second
defaultGatewayIdleShutdownDelay = 5 * time.Minute
)

var (
Expand Down Expand Up @@ -58,7 +58,7 @@ type gatewayCommandOptions struct {

MetricsEnabled bool
MetricsEnabledOverridden bool
SkipIPC bool
SkipIPC bool
}

// defaultNewAuthManager 创建默认网关认证器,并把具体持久化实现收敛在 CLI 装配层内部。
Expand Down
8 changes: 8 additions & 0 deletions internal/cli/gateway_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"testing"
"time"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -67,3 +68,10 @@ func TestMustReadInheritedWorkdir(t *testing.T) {
}
})
}

func TestNewGatewayIdleShutdownControllerUsesExpectedDefaultTimeout(t *testing.T) {
controller := newGatewayIdleShutdownController(nil, nil)
if controller.idleTimeout != 5*time.Minute {
t.Fatalf("idleTimeout = %v, want %v", controller.idleTimeout, 5*time.Minute)
}
}
Loading