Skip to content

Commit

Permalink
发布节点可能有自定义名字
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Sep 26, 2024
1 parent 94d9d78 commit ec7d0f3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Stardust.Server/Controllers/DeployController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ public Int32 Upload([FromBody] ServiceInfo[] services)
{
if (svc.Name.IsNullOrEmpty()) continue;

var app = AppDeploy.FindByName(svc.Name);
AppDeploy app = null;

// 发布节点可能有自定义名字
var dn = list.FirstOrDefault(e => e.DeployName.EqualIgnoreCase(svc.Name));
app = dn?.Deploy;

app ??= AppDeploy.FindByName(svc.Name);
app ??= new AppDeploy { Name = svc.Name/*, Enable = svc.Enable*/ };

//// 仅可用应用
Expand All @@ -128,7 +134,7 @@ public Int32 Upload([FromBody] ServiceInfo[] services)

rs += rs2;

var dn = list.FirstOrDefault(e => e.DeployId == app.Id);
dn ??= list.FirstOrDefault(e => e.DeployId == app.Id);
if (dn == null)
dn = new AppDeployNode { DeployId = app.Id, NodeId = _node.ID, Enable = svc.Enable };
else
Expand Down

0 comments on commit ec7d0f3

Please sign in to comment.