From 3bcd409056082076fa15d76fdf05013b4195713f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 9 Sep 2020 16:55:46 +0200 Subject: [PATCH] Fix self.loc race condition --- config/template_config.toml | 1 + worker.py | 1 + 2 files changed, 2 insertions(+) diff --git a/config/template_config.toml b/config/template_config.toml index 89b599c..77e0761 100644 --- a/config/template_config.toml +++ b/config/template_config.toml @@ -14,6 +14,7 @@ enabled_languages = ["it", "en", "uk", "ru", "zh_cn", "he"] # The default language to be set for users whose language cannot be autodetected or whose language is not enabled default_language = "it" # The language to fallback to if a string is missing in a specific language +# You should set it to either "it" or "en", other languages may be missing some strings as greed is updated fallback_language = "en" diff --git a/worker.py b/worker.py index ad7db71..5720876 100644 --- a/worker.py +++ b/worker.py @@ -51,6 +51,7 @@ class Worker(threading.Thread): self.chat: telegram.Chat = chat self.telegram_user: telegram.User = telegram_user self.cfg = cfg + self.loc = None # Open a new database session log.debug(f"Opening new database session for {self.name}") self.session = sqlalchemy.orm.sessionmaker(bind=engine)()