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
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public async Task<ActionResult<List<ApiConfigVM>>> GetAppConfig(string appId, [F
/// <returns></returns>
[TypeFilter(typeof(AdmBasicAuthenticationAttribute))]
[HttpGet()]
public async Task<ActionResult<List<ApiConfigVM>>> GetConfigs(string appId, [FromQuery] EnvString env)
public async Task<ActionResult<List<ApiConfigVM>>> GetConfigs(string appId, EnvString env)
{
ArgumentException.ThrowIfNullOrEmpty(appId);

Expand All @@ -105,7 +105,7 @@ public async Task<ActionResult<List<ApiConfigVM>>> GetConfigs(string appId, [Fro
/// <returns></returns>
[TypeFilter(typeof(AdmBasicAuthenticationAttribute))]
[HttpGet("{id}")]
public async Task<ActionResult<ApiConfigVM>> GetConfig(string id, [FromQuery] EnvString env)
public async Task<ActionResult<ApiConfigVM>> GetConfig(string id, EnvString env)
{
ArgumentException.ThrowIfNullOrEmpty(id);

Expand Down
3 changes: 2 additions & 1 deletion src/AgileConfig.Server.Apisite/InitService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ public InitService(IServiceScopeFactory serviceScopeFactory,

public async Task StartAsync(CancellationToken cancellationToken)
{
_systemInitializationService.TryInitDefaultEnvironment();//init DEV TEST STAGE PROD

if (Appsettings.IsAdminConsoleMode)
{
_systemInitializationService.TryInitDefaultEnvironment();//初始化环境 DEV TEST STAGE PROD
_systemInitializationService.TryInitJwtSecret();//初始化 jwt secret
_systemInitializationService.TryInitSaPassword(); // init super admin password
_systemInitializationService.TryInitDefaultApp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"serviceUnhealthInterval": 30, // 判断服务不健康的间隔,超出这个时间没响应过则认为不健康,单位:秒
"removeServiceInterval": 0, // 如果一个服务超出这个时间没有响应,则直接移除这个服务,单位:秒;如果设定为 <= 0,则不会移除,默认 0 。
"pathBase": "", //使用反向代理的时候,或许需要修改这个值 /xxx 必须/开头
"adminConsole": true,
"adminConsole": false,
"saPassword": "123456", //super admin 的密码
"defaultApp": "myapp", // 默认应用,每次重启都会尝试新建
"cluster": false, // 集群模式:服务启动后自动加入节点列表,服务启动的时候会获取容器的ip,端口默认5000,适合 docker compose 环境使用
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ public bool TryInitDefaultEnvironment()
Value = envArrayString,
CreateTime = DateTime.Now
};
sysInitRepository.SaveInitSetting(setting);
try
{
sysInitRepository.SaveInitSetting(setting);
}
catch (Exception e)
{
logger.LogError("TryInitDefaultEnvironment error, maybe exec this saveing action in parallel on another node.");
}
}

ISettingService.EnvironmentList = envArrayString.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
Expand Down
Loading