forked from Telodendria/Telodendria
Don't build the routing tree until absolutely necessary.
Saves us a lot of time and memory in case of an error.
This commit is contained in:
parent
4a5c7480aa
commit
19b0dcac5a
1 changed files with 9 additions and 9 deletions
18
src/Main.c
18
src/Main.c
|
@ -237,15 +237,6 @@ start:
|
|||
Log(LOG_DEBUG, "Opened database.");
|
||||
}
|
||||
|
||||
Log(LOG_NOTICE, "Building routing tree...");
|
||||
matrixArgs.router = RouterBuild();
|
||||
if (!matrixArgs.router)
|
||||
{
|
||||
Log(LOG_ERR, "Unable to build routing tree.");
|
||||
exit = EXIT_FAILURE;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
if (!ConfigExists(matrixArgs.db))
|
||||
{
|
||||
char *token;
|
||||
|
@ -525,6 +516,15 @@ start:
|
|||
Log(LOG_NOTICE, "Starting job scheduler...");
|
||||
CronStart(cron);
|
||||
|
||||
Log(LOG_NOTICE, "Building routing tree...");
|
||||
matrixArgs.router = RouterBuild();
|
||||
if (!matrixArgs.router)
|
||||
{
|
||||
Log(LOG_ERR, "Unable to build routing tree.");
|
||||
exit = EXIT_FAILURE;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
Log(LOG_NOTICE, "Starting server...");
|
||||
|
||||
for (i = 0; i < ArraySize(httpServers); i++)
|
||||
|
|
Loading…
Reference in a new issue