diff --git a/analytics.py b/analytics.py index 93da7af..6d0c0be 100644 --- a/analytics.py +++ b/analytics.py @@ -37,8 +37,11 @@ class Database(metaclass=SingletonMeta): # Enable autocommit so we don't have to call commit() after every transaction. self.connection.autocommit = True -# Create a global database instance. -log_db = Database() +try: + # Create a global database instance. + log_db = Database() +except: + print("No access to database. No logs available!!!") def lookup_location(ip, reader): try: