Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit67847e8

Browse files
authored
Merge pull request#130 from github/bugfix/cluster_apply
Do not fail if single cluster apply fails
2 parentsd252781 +1184474 commit67847e8

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

‎KustoSchemaTools/KustoClusterOrchestrator.cs‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,34 @@ public async Task<List<ScriptExecuteCommandResult>> ApplyAsync(string clusterCon
9696
varclusterUrl=changeSet.To.Url;
9797

9898
varkustoHandler=KustoClusterHandlerFactory.Create(clusterName,clusterUrl);
99-
varresult=awaitkustoHandler.WriteAsync(changeSet);
100-
101-
// Add the results from this cluster to the overall results list
102-
allResults.AddRange(result);
99+
try
100+
{
101+
varresult=awaitkustoHandler.WriteAsync(changeSet);
102+
103+
// Add the results from this cluster to the overall results list
104+
allResults.AddRange(result);
105+
}
106+
catch(Exceptionex)
107+
{
108+
Log.LogError(ex,$"Failed to apply changes to cluster:{clusterName}");
109+
allResults.Add(CreateFailedClusterResult(clusterName,clusterUrl,ex));
110+
}
103111
}
104112

105113
Log.LogInformation($"Finished applying. Total scripts executed:{allResults.Count}");
106114
returnallResults;
107115
}
116+
117+
privatestaticScriptExecuteCommandResultCreateFailedClusterResult(stringclusterName,stringclusterUrl,Exceptionexception)
118+
{
119+
returnnewScriptExecuteCommandResult
120+
{
121+
CommandType=$"cluster-script:{clusterName}",
122+
OperationId=Guid.Empty,
123+
Result="Failed",
124+
Reason=$"{exception.GetType().Name}:{exception.Message}",
125+
CommandText=$"Apply cluster '{clusterName}' ({clusterUrl})"
126+
};
127+
}
108128
}
109129
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp