Skip to content

Commit

Permalink
Request response attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
LishaRamon committed Dec 29, 2023
1 parent 00f3bdd commit a28d951
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/ingests/ingest_bard14_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests


SAVE_DB = True # True: save the data files(json) in addition to modifying the .db file
SAVE_DB = False # True: save the data files(json) in addition to modifying the .db file
RECREATE_DB = True # recreates the .db file from the data files
# LOAD THE DATABASE
db = load_simpledb('SIMPLE.db', recreatedb=RECREATE_DB)
Expand Down Expand Up @@ -49,8 +49,10 @@ def update_all_spectra(db):


# The website is up if the status code is 200 (checking validity of links)
request_response = requests.head(spectrum_value, original_spectrum_value)
status_code = (request_response.status_code)
request_response1 = requests.head(spectrum_value)
request_response2 = requests.head(original_spectrum_value)
status_code = (request_response1.status_code)
status_code = (request_response2.status_code)

if status_code != 200:
msg = f"Link invalid:{spectrum_value}"
Expand Down

0 comments on commit a28d951

Please sign in to comment.