Skip to content
Snippets Groups Projects
Unverified Commit d2ac5676 authored by Ravi Tripathi's avatar Ravi Tripathi Committed by GitHub
Browse files

Merge pull request #95 from diedpigs/fix-reg-logger

Fix user reg logger
parents c427a7c8 190a36a1
No related branches found
No related tags found
2 merge requests!147Merge previous default branch feat-cod-rmq into main,!94WIP: Merge feat_prod_rmq with feat_cod_rmq
......@@ -19,14 +19,14 @@ args = rc_util.get_args()
logger = rc_util.get_logger()
# Open registry table in DB
db = dataset.connect("sqlite:///reg_logger.db")
db = dataset.connect("sqlite:///.agent_db/reg_logger.db")
account_req_table = db["registry"]
# Define registration logger callback
def log_registration(ch, method, properties, body):
account_req = json.loads(body)
account_req["req_time"] = (datetime.now(),)
account_req["req_time"] = datetime.now()
account_req_table.insert(account_req)
logger.info("logged account request for %s", account_req["username"])
......@@ -37,5 +37,5 @@ logger.info("Start listening to queue: {}".format(task))
# Start consuming messages from queue with callback function
rc_rmq.start_consume(
{"queue": task, "routing_key": "create.*", "cb": log_registration}
{"queue": task, "routing_key": "request.*", "cb": log_registration}
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment