From 0b235df431f61f51d299a888b3aa611cd687d444 Mon Sep 17 00:00:00 2001
From: Bo-Chun Louis Chen <louistw@uab.edu>
Date: Thu, 13 May 2021 14:18:46 -0500
Subject: [PATCH] Update db path for agents

---
 prod_rmq_agents/notify_user.py     | 2 +-
 prod_rmq_agents/task_manager.py    | 2 +-
 prod_rmq_agents/user_reg_logger.py | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/prod_rmq_agents/notify_user.py b/prod_rmq_agents/notify_user.py
index 73570df..4f1dd3e 100644
--- a/prod_rmq_agents/notify_user.py
+++ b/prod_rmq_agents/notify_user.py
@@ -14,7 +14,7 @@ task = "notify_user"
 args = rc_util.get_args()
 logger = rc_util.get_logger(args)
 
-db = dataset.connect(f"sqlite:///.agent_db/user_reg.db")
+db = dataset.connect(f"sqlite:///{rcfg.db_path}/user_reg.db")
 table = db["users"]
 
 # Instantiate rabbitmq object
diff --git a/prod_rmq_agents/task_manager.py b/prod_rmq_agents/task_manager.py
index ec86874..9ad0b78 100644
--- a/prod_rmq_agents/task_manager.py
+++ b/prod_rmq_agents/task_manager.py
@@ -17,7 +17,7 @@ timeout = 30
 args = rc_util.get_args()
 logger = rc_util.get_logger(args)
 
-db = dataset.connect(f"sqlite:///.agent_db/user_reg.db")
+db = dataset.connect(f"sqlite:///{rcfg.db_path}/user_reg.db")
 table = db["users"]
 
 record = {
diff --git a/prod_rmq_agents/user_reg_logger.py b/prod_rmq_agents/user_reg_logger.py
index a9c878e..ea8f9ee 100755
--- a/prod_rmq_agents/user_reg_logger.py
+++ b/prod_rmq_agents/user_reg_logger.py
@@ -4,6 +4,7 @@ import dataset
 import rc_util
 from rc_rmq import RCRMQ
 from datetime import datetime
+import rabbit_config as rcfg
 
 # Define queue name
 task = "reg_logger"
@@ -18,7 +19,7 @@ args = rc_util.get_args()
 logger = rc_util.get_logger()
 
 # Open registry table in DB
-db = dataset.connect("sqlite:///.agent_db/reg_logger.db")
+db = dataset.connect(f"sqlite:///{rcfg.db_path}/reg_logger.db")
 account_req_table = db["registry"]
 
 
-- 
GitLab