work
This commit is contained in:
@@ -145,6 +145,18 @@ builder.Logging.Configure(options =>
|
||||
|
||||
var host = builder.Build();
|
||||
|
||||
// Fail fast if surface configuration is invalid at startup.
|
||||
using (var scope = host.Services.CreateScope())
|
||||
{
|
||||
var services = scope.ServiceProvider;
|
||||
var env = services.GetRequiredService<ISurfaceEnvironment>();
|
||||
var runner = services.GetRequiredService<ISurfaceValidatorRunner>();
|
||||
await runner.EnsureAsync(
|
||||
SurfaceValidationContext.Create(services, "Scanner.Worker.Startup", env.Settings),
|
||||
host.Services.GetRequiredService<IHostApplicationLifetime>().ApplicationStopping)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
await host.RunAsync();
|
||||
|
||||
public partial class Program;
|
||||
@@ -189,9 +201,8 @@ public sealed class SurfaceManifestStoreOptionsConfigurator : IConfigureOptions<
|
||||
|
||||
if (string.IsNullOrWhiteSpace(options.RootDirectory))
|
||||
{
|
||||
options.RootDirectory = Path.Combine(
|
||||
_cacheOptions.Value.ResolveRoot(),
|
||||
"manifests");
|
||||
var cacheRoot = _cacheOptions.Value.RootDirectory ?? Path.Combine(Path.GetTempPath(), "stellaops", "surface-cache");
|
||||
options.RootDirectory = Path.Combine(cacheRoot, "manifests");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user