Skip to content

Commit

Permalink
Merge pull request #12 from TranslatorSRI/novelty
Browse files Browse the repository at this point in the history
Fix another requests to httpx
  • Loading branch information
maximusunc authored Aug 11, 2023
2 parents 6490f70 + 5309ef1 commit cd588a4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/novelty/compute_novelty.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pandas as pd
from datetime import date
import requests
import httpx
import numpy as np
import traceback

Expand Down Expand Up @@ -75,9 +75,10 @@ def get_publication_info(pub_id):
request_id = "1df88223-c0f8-47f5-a1f3-661b944c7849"
full_url = f"{base_url}{pub_id}&request_id={request_id}"
try:
response = requests.get(full_url)
response.raise_for_status()
response = response.json()
with httpx.Client(timeout=30) as client:
response = client.get(full_url)
response.raise_for_status()
response = response.json()
except Exception:
response = {
"_meta": {
Expand Down

0 comments on commit cd588a4

Please sign in to comment.