refactor: 端口调整
This commit is contained in:
@@ -70,7 +70,7 @@ func (m *Manager) ReloadConfig() error {
|
||||
|
||||
config := &Config{
|
||||
Server: types.ServerConfig{
|
||||
Port: utils.ParseInteger(os.Getenv("PORT"), 3000),
|
||||
Port: utils.ParseInteger(os.Getenv("PORT"), 3001),
|
||||
Host: utils.GetEnvOrDefault("HOST", "0.0.0.0"),
|
||||
ReadTimeout: utils.ParseInteger(os.Getenv("SERVER_READ_TIMEOUT"), 120),
|
||||
WriteTimeout: utils.ParseInteger(os.Getenv("SERVER_WRITE_TIMEOUT"), 1800),
|
||||
|
@@ -130,7 +130,7 @@ func (sm *SystemSettingsManager) EnsureSettingsInitialized() error {
|
||||
}
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "3000"
|
||||
port = "3001"
|
||||
}
|
||||
value = fmt.Sprintf("http://%s:%s", host, port)
|
||||
}
|
||||
@@ -172,7 +172,7 @@ func (sm *SystemSettingsManager) GetAppUrl() string {
|
||||
}
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "3000"
|
||||
port = "3001"
|
||||
}
|
||||
return fmt.Sprintf("http://%s:%s", host, port)
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ type ConfigManager interface {
|
||||
// SystemSettings 定义所有系统配置项
|
||||
type SystemSettings struct {
|
||||
// 基础参数
|
||||
AppUrl string `json:"app_url" default:"http://localhost:3000" name:"项目地址" category:"基础参数" desc:"项目的基础 URL,用于拼接分组终端节点地址。系统配置优先于环境变量 APP_URL。"`
|
||||
AppUrl string `json:"app_url" default:"http://localhost:3001" name:"项目地址" category:"基础参数" desc:"项目的基础 URL,用于拼接分组终端节点地址。系统配置优先于环境变量 APP_URL。"`
|
||||
RequestLogRetentionDays int `json:"request_log_retention_days" default:"7" name:"日志保留时长(天)" category:"基础参数" desc:"请求日志在数据库中的保留天数,0为不清理日志。" validate:"min=0"`
|
||||
RequestLogWriteIntervalMinutes int `json:"request_log_write_interval_minutes" default:"5" name:"日志延迟写入周期(分钟)" category:"基础参数" desc:"请求日志从缓存写入数据库的周期(分钟),0为实时写入数据。" validate:"min=0"`
|
||||
|
||||
|
Reference in New Issue
Block a user