-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New illustration of caching and splitting GOLD records PLUS routine maintenance #125
Conversation
sample gold records
occasionally getting something like this from 2025-01-09 15:03:27,179 - INFO - Retrieved 0 biosamples for study Gs0032355 Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/mark/.cache/pypoetry/virtualenvs/sample-annotator-O-SG-H46-py3.10/lib/python3.10/site-packages/click/core.py", line 1161, in call make: *** [make-gold-cache.Makefile:39: load-gold-biosamples-into-mongo] Error 1 |
ChatGPT suggests this... but that would have to go upstream in gold_cahce.py, right? import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
def create_session():
retries = Retry(
total=5, # Total retry attempts
backoff_factor=0.3, # Wait time between retries: 0.3, 0.6, 1.2, etc.
status_forcelist=[500, 502, 503, 504], # Retry on server errors
allowed_methods=["HEAD", "GET", "OPTIONS"], # Retry for safe methods
)
session = requests.Session()
adapter = HTTPAdapter(max_retries=retries)
session.mount("http://", adapter)
session.mount("https://", adapter)
return session Use the session in your requestssession = create_session()
response = session.get(url, params=params, auth=(user, passwd)) |
Another error, but this one can't just be restarted 2025-01-10 07:49:57,990 - WARNING - Duplicate key error for Gs0110165 Traceback (most recent call last): |
updated
pyproject.toml
, GitHub actions etc so thatmake test
would work