Skip to content

Commit

Permalink
Run url checks in threads not subprocesses.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed May 3, 2024
1 parent 6ebcf2c commit 601aa05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions schemas/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import urllib.request
from jsonschema import validate as json_validate
from multiprocessing.pool import Pool
from multiprocessing.dummy import Pool as ThreadPool


GENERIC_EA_SCHEMA = 'generic-ea-schema.json'
Expand Down Expand Up @@ -46,7 +46,7 @@ def validate_builds(builds):


def check_urls_exist(download_base_url, files):
with Pool() as pool:
with ThreadPool() as pool:
download_urls = [f'{download_base_url}{file["filename"]}{extension}' for extension in ['', '.sha256'] for file in files]
pool.map(check_url_exists, download_urls)

Expand Down

0 comments on commit 601aa05

Please sign in to comment.