Skip to content

Commit 79ccf83

Browse files
committed
Merge branch 'develop'
2 parents 6330667 + 946bf92 commit 79ccf83

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pipeline {
33
agent none
44

55
environment {
6-
ReleaseNumber = '0.9.0'
6+
ReleaseNumber = '0.9.1'
77
}
88
stages {
99

src/OneScript/Database/DatabaseExtensions.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ This Source Code Form is subject to the terms of the
1010
using Microsoft.EntityFrameworkCore;
1111
using Microsoft.Extensions.Configuration;
1212
using Microsoft.Extensions.DependencyInjection;
13+
using Microsoft.Extensions.Logging;
1314
using Microsoft.Extensions.Options;
15+
using OneScript.WebHost.Application;
1416
using OneScript.WebHost.Infrastructure;
1517
using ScriptEngine;
1618

@@ -22,9 +24,6 @@ public static class DatabaseExtensions
2224

2325
public static void AddDatabaseByConfiguration(this IServiceCollection services, IConfiguration config)
2426
{
25-
if (!config.GetChildren().Any(item => item.Key == ConfigSectionName))
26-
return;
27-
2827
var dbSettings = config.GetSection(ConfigSectionName);
2928

3029
// Делаем доступным для прочих частей приложения
@@ -70,9 +69,11 @@ private static DbContextOptions<ApplicationDbContext> ConfigureDbOptions(IServic
7069

7170
public static void PrepareDbEnvironment(IServiceProvider services, RuntimeEnvironment environment)
7271
{
72+
var logger = services.GetService<ILogger<ApplicationInstance>>();
7373
var dbOptions = services.GetService<IOptions<OscriptDbOptions>>().Value;
7474
if (dbOptions != null && dbOptions.DbType != SupportedDatabase.Unknown)
7575
{
76+
logger.LogDebug($"Database enabled: {dbOptions.DbType}");
7677
var dbctx = services.GetService<ApplicationDbContext>();
7778
dbctx.Database.EnsureCreated();
7879

@@ -86,6 +87,10 @@ public static void PrepareDbEnvironment(IServiceProvider services, RuntimeEnviro
8687
environment.InjectGlobalProperty(ib, "ИнформационнаяБаза", true);
8788
environment.InjectGlobalProperty(ib, "InfoBase", true);
8889
}
90+
else
91+
{
92+
logger.LogDebug("No database configured");
93+
}
8994
}
9095
}
9196

src/OneScript/Program.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ public static void Main(string[] args)
5656
var options = ConfigureHostingMode(builder, configInstance);
5757

5858
builder.UseConfiguration(configInstance)
59-
.UseKestrel(opts => opts.AllowSynchronousIO = true)
59+
.UseKestrel(opts =>
60+
{
61+
configInstance.Bind("Kestrel", opts);
62+
opts.AllowSynchronousIO = true;
63+
})
6064
.UseIISIntegration()
6165
.UseStartup<Startup>()
6266
.UseApplicationInsights()

0 commit comments

Comments
 (0)