Skip to content

Commit

Permalink
Updates from review
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Jan 12, 2024
1 parent bc6080d commit 4e2f403
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,9 @@ Action<BuildJobOptions> configureOptions
public static IMachineBuilder AddBuildJobService(this IMachineBuilder builder, IConfiguration config)
{
builder.Services.Configure<BuildJobOptions>(config);
var options = config.Get<BuildJobOptions>() ?? throw new InvalidOperationException("BuildJobOPtions are required");
return builder.AddBuildJobService(options);
var buildJobOptions = new BuildJobOptions();
config.GetSection(BuildJobOptions.Key).Bind(buildJobOptions);
return builder.AddBuildJobService(buildJobOptions);
}

public static IMachineBuilder AddBuildJobService(this IMachineBuilder builder)
Expand All @@ -381,11 +382,9 @@ public static IMachineBuilder AddBuildJobService(this IMachineBuilder builder)
{
builder.AddBuildJobService(builder.Configuration.GetSection(BuildJobOptions.Key));

string EnginesDir = builder.Configuration
.GetSection(SmtTransferEngineOptions.Key)!
.GetValue<string>("EnginesDir") ?? throw new InvalidOperationException("EnginesDir is required");

string driveLetter = Path.GetPathRoot(EnginesDir)![..1];
var smtTransferEngineOptions = new SmtTransferEngineOptions();
builder.Configuration.GetSection(SmtTransferEngineOptions.Key).Bind(smtTransferEngineOptions);
string driveLetter = Path.GetPathRoot(smtTransferEngineOptions.EnginesDir)![..1];
// add health check for disk storage capacity
builder.Services
.AddHealthChecks()
Expand Down

0 comments on commit 4e2f403

Please sign in to comment.