From 5a7a6ea71ce03f0927afacf0f96f65fabe8b1af8 Mon Sep 17 00:00:00 2001 From: Frisk Date: Tue, 1 Oct 2024 00:20:03 +0200 Subject: [PATCH] Fix startup if extension is enabled and setting not defined --- extensions/hooks/db_connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/hooks/db_connection.py b/extensions/hooks/db_connection.py index e8dfc1c..d6d1b16 100644 --- a/extensions/hooks/db_connection.py +++ b/extensions/hooks/db_connection.py @@ -55,7 +55,8 @@ class DBConnector: self.session.close() -db_singleton = DBConnector() +if dbconn: + db_singleton = DBConnector() @post_hook def db_interaction_hook(message, metadata, context, change):