Change logging level to ERROR and increase retry delay to 10 seconds in vectorizer.py
Browse files
controllers/vectorizer.py
CHANGED
@@ -15,7 +15,7 @@ from astrapy.info import CollectionVectorServiceOptions
|
|
15 |
logging.basicConfig(
|
16 |
format='%(asctime)s - %(levelname)s - %(funcName)s - %(message)s',
|
17 |
datefmt="%Y-%m-%d %H:%M:%S",
|
18 |
-
level=logging.
|
19 |
|
20 |
ASTRA_DB_APPLICATION_TOKEN = os.environ['ASTRA_DB_APPLICATION_TOKEN']
|
21 |
ASTRA_DB_API_ENDPOINT = os.environ['ASTRA_DB_API_ENDPOINT']
|
@@ -78,7 +78,7 @@ def add_documents_with_retry(chunks, ids, max_retries=3):
|
|
78 |
except (ConnectionError, TimeoutError) as e:
|
79 |
logging.info("Attempt %d failed: %s", attempt + 1, e)
|
80 |
if attempt < max_retries - 1:
|
81 |
-
time.sleep(
|
82 |
else:
|
83 |
logging.error("Max retries reached. Operation failed.")
|
84 |
logging.error(ids)
|
|
|
15 |
logging.basicConfig(
|
16 |
format='%(asctime)s - %(levelname)s - %(funcName)s - %(message)s',
|
17 |
datefmt="%Y-%m-%d %H:%M:%S",
|
18 |
+
level=logging.ERROR)
|
19 |
|
20 |
ASTRA_DB_APPLICATION_TOKEN = os.environ['ASTRA_DB_APPLICATION_TOKEN']
|
21 |
ASTRA_DB_API_ENDPOINT = os.environ['ASTRA_DB_API_ENDPOINT']
|
|
|
78 |
except (ConnectionError, TimeoutError) as e:
|
79 |
logging.info("Attempt %d failed: %s", attempt + 1, e)
|
80 |
if attempt < max_retries - 1:
|
81 |
+
time.sleep(10)
|
82 |
else:
|
83 |
logging.error("Max retries reached. Operation failed.")
|
84 |
logging.error(ids)
|