Skip to content

Commit

Permalink
use session
Browse files Browse the repository at this point in the history
  • Loading branch information
pineapplehunter committed Sep 26, 2024
1 parent e985127 commit a86f416
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def main():
with open(lockfile_path, 'r') as f:
lockfile = json.load(f)

s = requests.Session()

# Loop over each package in the packages section of the lockfile
for package_key in lockfile['packages']:
# Ignore the empty key & local packages
Expand All @@ -34,7 +36,7 @@ def main():
version = package['version']

# Fetch the package metadata from the registry
response = requests.get(f"{registry_url + package_name}/{version}")
response = s.get(f"{registry_url + package_name}/{version}")
if response.status_code == 200:
package_data = response.json()
# Get the dist field for the specific version
Expand Down

0 comments on commit a86f416

Please sign in to comment.