From 47fb2db6ed83bb4eea7b958a19cf059e1e868fae Mon Sep 17 00:00:00 2001 From: evilhero Date: Sat, 17 Mar 2018 22:43:04 -0400 Subject: [PATCH] FIX: Fix for db not being created on new installs when in maintenance mode --- mylar/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mylar/__init__.py b/mylar/__init__.py index 5b4c301c..896b3635 100644 --- a/mylar/__init__.py +++ b/mylar/__init__.py @@ -191,6 +191,13 @@ def initialize(config_file): else: vers = 'NONE' + # Initialize the database + logger.info('Checking to see if the database has all tables....') + try: + dbcheck() + except Exception, e: + logger.error('Cannot connect to the database: %s' % e) + if MAINTENANCE is False: #try to get the local IP using socket. Get this on every startup so it's at least current for existing session. import socket @@ -218,13 +225,6 @@ def initialize(config_file): logger.info('Config GIT Branch: %s' % CONFIG.GIT_BRANCH) - # Initialize the database - logger.info('Checking to see if the database has all tables....') - try: - dbcheck() - except Exception, e: - logger.error('Cannot connect to the database: %s' % e) - # Check for new versions (autoupdate) if CONFIG.CHECK_GITHUB_ON_STARTUP: try: