Skip to content

Commit

Permalink
refactored code to reflect suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
mudiagaobrikisil authored and johnml1135 committed Nov 4, 2024
1 parent dcc19b0 commit 37e5a45
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/Serval/src/Serval.ApiServer/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@
"LogLevel": {
"System.Net.Http.HttpClient": "Warning"
}
},
"ServalSettings": {
"ReleaseVersion": "1.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1047,9 +1047,12 @@ public async Task<ActionResult<TranslationBuildDto>> StartBuildAsync(
CancellationToken cancellationToken
)
{
string deploymentVersion = configuration.GetValue<string>("deploymentVersion") ?? "Unknown";

Engine engine = await _engineService.GetAsync(id, cancellationToken);
await AuthorizeAsync(engine);
Build build = Map(engine, buildConfig);
Build build = Map(engine, buildConfig, deploymentVersion);

await _engineService.StartBuildAsync(build, cancellationToken);

TranslationBuildDto dto = Map(build);
Expand Down Expand Up @@ -1312,10 +1315,8 @@ private Engine Map(TranslationEngineConfigDto source)
};
}

private Build Map(Engine engine, TranslationBuildConfigDto source)
private static Build Map(Engine engine, TranslationBuildConfigDto source, string deploymentVersion)
{
string deploymentVersion = configuration.GetValue<string>("DeploymentVersion") ?? "Unknown";

return new Build
{
EngineRef = engine.Id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,7 @@ public void TearDown()
_env.Dispose();
}

public class TestEnvironment : DisposableBase
private class TestEnvironment : DisposableBase
{
private readonly IServiceScope _scope;
private readonly MongoClient _mongoClient;
Expand Down

0 comments on commit 37e5a45

Please sign in to comment.