From 10dbe37f74e5c1b50df0eef1574ef961b4510912 Mon Sep 17 00:00:00 2001 From: Devon Joseph Leadman Date: Wed, 23 Oct 2024 13:26:06 -0400 Subject: [PATCH] email changes 4 --- start_prod.py | 6 +----- start_test.py | 9 ++++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/start_prod.py b/start_prod.py index 3041140..3e9f5b2 100755 --- a/start_prod.py +++ b/start_prod.py @@ -10,8 +10,6 @@ from subprocess import * from time import sleep import argparse -import detect_transfer -import seed_cluster from RDAS_MEMGRAPH_APP.Alert import Alert from RDAS_MEMGRAPH_APP.Transfer import Transfer from datetime import datetime @@ -30,9 +28,7 @@ print('checking for update...') # Detect new dumps in the production server transfer_detection,last_updates = transfer_module.detect(sysvars.transfer_path) - approval_detection,last_updates_approval = transfer_module.detect(sysvars.approved_path) - new_dumps = [k for (k,v) in transfer_detection.items() if v] - new_dumps_approval = [k for (k,v) in approval_detection.items() if v] + new_dumps = transfer_detection # Sets the current db files last transfer date to today so it doesnt load and send emails upon script starting if init: diff --git a/start_test.py b/start_test.py index 9102e30..ba876b9 100644 --- a/start_test.py +++ b/start_test.py @@ -26,12 +26,15 @@ recip = sysvars.contacts['test'] today_str = datetime.today().strftime('%m/%d/%y') +# INIT +transfer_detection,lastupdates = transfer_module.detect(sysvars.transfer_path) +transfer_detection,lastupdates = transfer_module.detect(sysvars.approved_path) + while True: # Detects all new dump files in the transfer folder of the TEST server transfer_detection,lastupdates = transfer_module.detect(sysvars.transfer_path) - new_dumps = transfer_detection[0] + new_dumps = transfer_detection for db_name in new_dumps: - transfer_module.seed(db_name,sysvars.transfer_path) transfer_module.seed(db_name,sysvars.transfer_path) print('database seeded within cluster') @@ -71,7 +74,7 @@ # Detects if a new dump file was loaded into the approved folder transfer_detection,lastupdates = transfer_module.detect(sysvars.approved_path) - new_dumps = transfer_detection[0] + new_dumps = transfer_detection print(new_dumps) for db_name in new_dumps: