Skip to content

Commit

Permalink
More debug statement
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Apr 3, 2024
1 parent 976c06e commit d7567b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,18 @@ def process_rawdata(file_download_url, aoi_id, feedback=False):
headers = {
'Referer': 'https://fair-dev.hotosm.org/' # TODO : Use request uri
}
logging.info(f"Started Processing rawdata for {aoi_id}")
logging.debug(f"Started downloading zip raw for {aoi_id}")
r = requests.get(file_download_url, headers=headers)
logging.debug(f"Downloaded zip raw for {aoi_id}")
# Check whether the export path exists or not
path = "temp/"
isExist = os.path.exists(path)
if not isExist:
# Create a exports directory because it does not exist
os.makedirs(path)
file_temp_path = os.path.join(path, f"{str(uuid4())}.zip") # unique
open(file_temp_path, "wb").write(r.content)
logging.debug(f"Zip written to disk : {aoi_id}")

with ZipFile(file_temp_path, "r") as zipObj:
# Get a list of all archived file names from the zip
listOfFileNames = zipObj.namelist()
Expand Down

0 comments on commit d7567b2

Please sign in to comment.