Move where we open the database

This commit is contained in:
Jordan Bancino 2022-11-21 16:39:38 +00:00
parent 0c6c1e5b19
commit a0304f4062

View file

@ -445,7 +445,6 @@ main(int argc, char **argv)
tConfig->uid = NULL;
tConfig->gid = NULL;
matrixArgs.db = DbOpen(".", tConfig->maxCache);
if (!tConfig->maxCache)
{
@ -465,6 +464,8 @@ main(int argc, char **argv)
tConfig->maxCache = DB_MIN_CACHE;
}
matrixArgs.db = DbOpen(".", tConfig->maxCache);
if (!matrixArgs.db)
{
Log(lc, LOG_ERROR, "Unable to open data directory as a database.");