Merge branch 'dev' into feature/sections

This commit is contained in:
Степанов Дмитрий 2023-12-07 10:15:42 +05:00
commit b441d03d31
4 changed files with 7 additions and 10 deletions

View File

@ -2,6 +2,7 @@
using System; using System;
using System.Linq; using System.Linq;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using System.Diagnostics;
namespace AsbCloudDb namespace AsbCloudDb
{ {
@ -12,12 +13,16 @@ namespace AsbCloudDb
db.SetCommandTimeout(TimeSpan.FromMinutes(5)); db.SetCommandTimeout(TimeSpan.FromMinutes(5));
if (db.EnsureCreated()) if (db.EnsureCreated())
{ {
Trace.TraceInformation("Creating DB");
Console.WriteLine("Creating DB");
db.CreateMigrationTable(); db.CreateMigrationTable();
db.WriteMigrationsInfo(); db.WriteMigrationsInfo();
} }
else else
{ {
Trace.TraceInformation("Migrating DB");
db.SetCommandTimeout(TimeSpan.FromMinutes(20)); db.SetCommandTimeout(TimeSpan.FromMinutes(20));
Console.WriteLine("db.Migrate()");
db.Migrate(); db.Migrate();
} }
} }

View File

@ -38,13 +38,6 @@ namespace AsbCloudInfrastructure
backgroundWorker.Add(MakeMemoryMonitoringWork(), TimeSpan.FromMinutes(1)); backgroundWorker.Add(MakeMemoryMonitoringWork(), TimeSpan.FromMinutes(1));
var notificationBackgroundWorker = provider.GetRequiredService<NotificationBackgroundWorker>(); var notificationBackgroundWorker = provider.GetRequiredService<NotificationBackgroundWorker>();
Task.Delay(1_000)
.ContinueWith(async (_) =>
{
await backgroundWorker.StartAsync(CancellationToken.None);
await notificationBackgroundWorker.StartAsync(CancellationToken.None);
});
} }
static Work MakeMemoryMonitoringWork() static Work MakeMemoryMonitoringWork()

View File

@ -81,7 +81,8 @@ namespace AsbCloudWebApi
c.IncludeXmlComments(xmlPath, includeControllerXmlComment); c.IncludeXmlComments(xmlPath, includeControllerXmlComment);
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "AsbCloudApp.xml"), includeControllerXmlComment); c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "AsbCloudApp.xml"), includeControllerXmlComment);
c.AddSignalRSwaggerGen(options => { c.AddSignalRSwaggerGen(options =>
{
options.DisplayInDocument("signalr"); options.DisplayInDocument("signalr");
options.UseHubXmlCommentsSummaryAsTagDescription = true; options.UseHubXmlCommentsSummaryAsTagDescription = true;
options.UseHubXmlCommentsSummaryAsTag = true; options.UseHubXmlCommentsSummaryAsTag = true;

View File

@ -7,8 +7,6 @@ namespace AsbCloudWebApi
{ {
// Uncomment next line to find wired exceptions by tracing. // Uncomment next line to find wired exceptions by tracing.
//static TraceListenerView trace4debug = new TraceListenerView(); //static TraceListenerView trace4debug = new TraceListenerView();
enum A { a = 1 << 2 }
public static void Main(string[] args) public static void Main(string[] args)
{ {
var host = CreateHostBuilder(args).Build(); var host = CreateHostBuilder(args).Build();