mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 23:52:36 +01:00
Properly stop logspam
This commit is contained in:
@@ -15,7 +15,6 @@ using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Tgstation.Server.Host.Components;
|
||||
using Tgstation.Server.Host.Components.Chat;
|
||||
using Tgstation.Server.Host.Components.Chat.Commands;
|
||||
using Tgstation.Server.Host.Components.Watchdog;
|
||||
using Tgstation.Server.Host.Configuration;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System;
|
||||
#if !DEBUG
|
||||
using System.Linq;
|
||||
#endif
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Tgstation.Server.Host.Configuration;
|
||||
@@ -136,9 +138,14 @@ namespace Tgstation.Server.Host.Models
|
||||
/// <inheritdoc />
|
||||
public async Task Initialize(CancellationToken cancellationToken)
|
||||
{
|
||||
#if DEBUG
|
||||
await Database.EnsureCreatedAsync().ConfigureAwait(false);
|
||||
var wasEmpty = (await Users.CountAsync().ConfigureAwait(false)) == 0;
|
||||
#else
|
||||
var migrations = await Database.GetAppliedMigrationsAsync().ConfigureAwait(false);
|
||||
var wasEmpty = !migrations.Any();
|
||||
await Database.MigrateAsync(cancellationToken).ConfigureAwait(false);
|
||||
#endif
|
||||
if (wasEmpty)
|
||||
await databaseSeeder.SeedDatabase(this, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
},
|
||||
"Console": {
|
||||
"LogLevel": {
|
||||
"Microsoft.EntityFrameworkCore": "Warning",
|
||||
"Default": "Trace"
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user