put try and continue

This commit is contained in:
2026-04-04 23:42:18 +11:00
parent 9173d551f4
commit 1681f48bbf
+21 -3
View File
@@ -104,8 +104,18 @@ using (var scope = app.Services.CreateScope())
if (db != null) if (db != null)
{ {
db.Migrate(); try
db.EnsureCreated(); {
using var cts = new CancellationTokenSource();
CancellationToken cancellationToken = cts.Token;
await db.MigrateAsync(cancellationToken);
db.EnsureCreated();
}
catch
{
//continue
}
var staff = context.GetService<Seed>(); var staff = context.GetService<Seed>();
int id = staff.InsertOneUser(); int id = staff.InsertOneUser();
if (id < 0) if (id < 0)
@@ -114,7 +124,15 @@ using (var scope = app.Services.CreateScope())
if (databaseCreator != null) if (databaseCreator != null)
{ {
//if (!databaseCreator.Exists()) //if (!databaseCreator.Exists())
databaseCreator.CreateTables(); try
{
databaseCreator.CreateTables();
}
catch
{
//continue
}
} }
id = staff.InsertOneUser(); id = staff.InsertOneUser();
} }