diff --git a/ProcessorComponents.py b/ProcessorComponents.py index 963e97fd3028530faf9bd4c80acee04207e4c2a7..9e25b26baae8c930a21ce98919f7d6c2b23a3035 100644 --- a/ProcessorComponents.py +++ b/ProcessorComponents.py @@ -360,7 +360,10 @@ def get_ODK_form_as_csv(form_credentials: dict, jobPath: str, config: dict, stat ODK_copy_success = False days_back = 1 - while ((not ODK_copy_success) and (days_back <= 21)): + acceptable_days_back = int(config['Survey']['AcceptableDowntimeDays']) + logger.debug(f"Acceptable server downtime is set to {acceptable_days_back} days") + + while ((not ODK_copy_success) and (days_back <= acceptable_days_back)): current_date = datetime.datetime.strptime(config['StartString'],'%Y%m%d') past_date = current_date - datetime.timedelta(days=days_back) @@ -700,7 +703,10 @@ def get_kobotoolbox_form_as_csv(form_credentials: dict, jobPath: str, config: di copy_success = False days_back = 1 - while ((not copy_success) and (days_back <= 7)): + acceptable_days_back = int(config['Survey']['AcceptableDowntimeDays']) + logger.debug(f"Acceptable server downtime is set to {acceptable_days_back} days") + + while ((not copy_success) and (days_back <= acceptable_days_back)): current_date = datetime.datetime.strptime(config['StartString'],'%Y%m%d') @@ -964,7 +970,10 @@ def get_WRSIS_form_as_csv(form_credentials: dict, jobPath: str, config: dict, st copy_success = False days_back = 1 - while ((not copy_success) and (days_back <= 7)): + acceptable_days_back = int(config['Survey']['AcceptableDowntimeDays']) + logger.debug(f"Acceptable server downtime is set to {acceptable_days_back} days") + + while ((not copy_success) and (days_back <= acceptable_days_back)): current_date = datetime.datetime.strptime(config['StartString'],'%Y%m%d')