Skip to content

Commit

Permalink
fix: Don't use cached response (#33)
Browse files Browse the repository at this point in the history
* fix: Set cache control as no-cache

* chore: Bump version to 1.0.13
  • Loading branch information
karatugo authored Mar 22, 2024
1 parent 4cfd639 commit 29150bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion gwas_sumstats_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,16 @@ def download_with_requests(url,
Arguments:
url -- request url
params -- requests parameters
headers -- request headers
headers -- request headers, modified to include cache-control
Return:
Content from URL if status code is 200 or None
"""
if headers is None:
headers = {}

headers.update({'Cache-Control': 'no-cache', 'Pragma': 'no-cache'})

s = requests.Session()
retries = Retry(total=5, backoff_factor=2, status_forcelist=[429, 500, 502, 503, 504])
s.mount(url, HTTPAdapter(max_retries=retries))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gwas-sumstats-tools"
version = "1.0.12"
version = "1.0.13"
description = ""
authors = ["jdhayhurst <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 29150bd

Please sign in to comment.