Fix startup migrations
This commit is contained in:
@@ -21,7 +21,17 @@ int main(int argc, char *argv[])
|
||||
.getCustomConfig()
|
||||
.get("migrations_path", "migrations")
|
||||
.asString();
|
||||
visione::repositories::MigrationRunner::run(migrationsPath);
|
||||
drogon::app().getLoop()->runAfter(0.0, [migrationsPath]() {
|
||||
try
|
||||
{
|
||||
visione::repositories::MigrationRunner::run(migrationsPath);
|
||||
}
|
||||
catch (const std::exception &error)
|
||||
{
|
||||
LOG_FATAL << "Migration failed: " << error.what();
|
||||
drogon::app().quit();
|
||||
}
|
||||
});
|
||||
|
||||
drogon::app().run();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user