Merge pull request #201 from Kav-K/hiharu

move settings/mod db into shared
Kaveen Kumarasinghe 1 year ago committed by GitHub
commit 55a9424748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,7 @@ from services.moderations_service import Moderation, ThresholdSet
MOD_DB = None
try:
print("Attempting to retrieve the General and Moderations DB")
MOD_DB = SqliteDict("main_db.sqlite", tablename="moderations", autocommit=True)
MOD_DB = SqliteDict(EnvService.find_shared_file("main_db.sqlite"), tablename="moderations", autocommit=True)
except Exception as e:
print("Failed to retrieve the General and Moderations DB")
raise e

@ -49,8 +49,8 @@ MOD_DB = None
GENERAL_DB = None
try:
print("Attempting to retrieve the General and Moderations DB")
MOD_DB = SqliteDict("main_db.sqlite", tablename="moderations", autocommit=True)
GENERAL_DB = SqliteDict("main_db.sqlite", tablename="general", autocommit=True)
MOD_DB = SqliteDict(EnvService.find_shared_file("main_db.sqlite"), tablename="moderations", autocommit=True)
GENERAL_DB = SqliteDict(EnvService.find_shared_file("main_db.sqlite"), tablename="general", autocommit=True)
print("Retrieved the General and Moderations DB")
except Exception as e:
print("Failed to retrieve the General and Moderations DB. The bot is terminating.")

@ -32,7 +32,7 @@ from services.environment_service import EnvService
from models.openai_model import Model
__version__ = "10.9.7"
__version__ = "10.9.8"
PID_FILE = Path("bot.pid")

@ -347,7 +347,7 @@ class EnvService:
print(
"No user key database path was provided. Defaulting to user_key_db.sqlite"
)
user_key_db_path = "user_key_db.sqlite"
user_key_db_path = EnvService.find_shared_file("user_key_db.sqlite")
else:
# append "user_key_db.sqlite" to USER_KEY_DB_PATH if it doesn't already end with .sqlite
if not user_key_db_path.match("*.sqlite"):

Loading…
Cancel
Save