Fix bootstrap

pull/4/head
Ogoun 2 years ago
parent c69a588b01
commit 06dc99456f

@ -29,6 +29,10 @@ namespace ZeroLevel
public BootstrapFluent(IZeroService service)
{
if (service == null)
{
throw new ArgumentNullException(nameof(service));
}
_service = service;
}
@ -45,7 +49,15 @@ namespace ZeroLevel
public IServiceExecution Run()
{
_service.Start();
try
{
_service?.Start();
}
catch (Exception ex)
{
Log.Error(ex, $"[Bootstrap] Service {_service?.Name} run error");
return null;
}
return this;
}
@ -119,7 +131,7 @@ namespace ZeroLevel
Func<bool> postStartConfiguration = null)
where T : IZeroService
{
var service = Initialize<T>(args, Configuration.ReadSetFromApplicationConfig(),
var service = Initialize<T>(args, null,
preStartConfiguration, postStartConfiguration);
return new BootstrapFluent(service);
}
@ -130,7 +142,7 @@ namespace ZeroLevel
Func<bool> postStartConfiguration = null)
where T : IZeroService
{
var service = Initialize<T>(args, configuration(), preStartConfiguration, postStartConfiguration);
var service = Initialize<T>(args, configuration?.Invoke(), preStartConfiguration, postStartConfiguration);
return new BootstrapFluent(service);
}
@ -143,8 +155,12 @@ namespace ZeroLevel
IZeroService service = null;
IConfigurationSet config = Configuration.DefaultSet;
config.CreateSection("commandline", Configuration.ReadFromCommandLine(args));
if (configurationSet != null)
{
config.Merge(configurationSet);
}
Log.CreateLoggingFromConfiguration(Configuration.DefaultSet);
if (preStartConfiguration != null)
{
try

@ -6,16 +6,16 @@
</Description>
<Authors>ogoun</Authors>
<Company>ogoun</Company>
<AssemblyVersion>3.3.9.2</AssemblyVersion>
<PackageReleaseNotes>Partition storage. DropCache method</PackageReleaseNotes>
<AssemblyVersion>3.3.9.3</AssemblyVersion>
<PackageReleaseNotes>Update Bootstrap</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/ogoun/Zero/wiki</PackageProjectUrl>
<Copyright>Copyright Ogoun 2023</Copyright>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageIconUrl></PackageIconUrl>
<RepositoryUrl>https://github.com/ogoun/Zero</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>3.3.9.2</Version>
<FileVersion>3.3.9.2</FileVersion>
<Version>3.3.9.3</Version>
<FileVersion>3.3.9.3</FileVersion>
<Platforms>AnyCPU;x64;x86</Platforms>
<PackageIcon>zero.png</PackageIcon>
<DebugType>full</DebugType>

Loading…
Cancel
Save

Powered by TurnKey Linux.