From 911947ad5d6dda682fdbe2bbbb470a517909a6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Almeida?= Date: Mon, 25 Nov 2024 10:17:50 +0000 Subject: [PATCH] activate others --- mainv2.py | 75 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/mainv2.py b/mainv2.py index 9785f3b..d5a13d2 100644 --- a/mainv2.py +++ b/mainv2.py @@ -1,11 +1,12 @@ -import socket -import time -import requests -import os import json import logging +import os +import socket +import time from logging.handlers import RotatingFileHandler +import requests + # Define the directory and ensure it exists log_directory = "logs" if not os.path.exists(log_directory): @@ -521,39 +522,39 @@ def check_website_status(url, body=None): def main(): while True: - # try: - # chek_preprocessor_data(BUNDLES, LENSES, PATIENT_IDS, BASE_URL) - # except Exception as err: - # logger.debug(f"Error on function chek_preprocessor_data -> {err}") - # time.sleep(10) - # try: - # chek_all_lenses_data(BUNDLES, PATIENT_IDS, BASE_URL) - # except Exception as err: - # logger.debug(f"Error on function chek_all_lenses_data -> {err}") - - # time.sleep(10) - # try: - # chek_all_preprocess_data(BUNDLES, PATIENT_IDS, BASE_URL) - # except Exception as err: - # logger.debug(f"Error on function chek_all_preprocess_data -> {err}") - - # time.sleep(10) - # try: - # chek_all_prpcessor_with_post_data(BUNDLES, PATIENT_IDS, BASE_URL) - # except Exception as err: - # logger.debug( - # f"Error on function chek_all_prpcessor_with_post_data -> {err}" - # ) - - # time.sleep(10) - # try: - # chek_lenses_foralreadypreprocess_data( - # PREPROCBUNDLES, LENSES, PATIENT_IDS, BASE_URL - # ) - # except Exception as err: - # logger.debug( - # f"Error on function chek_lenses_foralreadypreprocess_data -> {err}" - # ) + try: + chek_preprocessor_data(BUNDLES, LENSES, PATIENT_IDS, BASE_URL) + except Exception as err: + logger.debug(f"Error on function chek_preprocessor_data -> {err}") + time.sleep(10) + try: + chek_all_lenses_data(BUNDLES, PATIENT_IDS, BASE_URL) + except Exception as err: + logger.debug(f"Error on function chek_all_lenses_data -> {err}") + + time.sleep(10) + try: + chek_all_preprocess_data(BUNDLES, PATIENT_IDS, BASE_URL) + except Exception as err: + logger.debug(f"Error on function chek_all_preprocess_data -> {err}") + + time.sleep(10) + try: + chek_all_prpcessor_with_post_data(BUNDLES, PATIENT_IDS, BASE_URL) + except Exception as err: + logger.debug( + f"Error on function chek_all_prpcessor_with_post_data -> {err}" + ) + + time.sleep(10) + try: + chek_lenses_foralreadypreprocess_data( + PREPROCBUNDLES, LENSES, PATIENT_IDS, BASE_URL + ) + except Exception as err: + logger.debug( + f"Error on function chek_lenses_foralreadypreprocess_data -> {err}" + ) time.sleep(10) try: