From 21fe9c525b6aa81fa72731f54c9ec68c04eb7dac Mon Sep 17 00:00:00 2001 From: Chris Khan Date: Sat, 31 Dec 2022 00:35:18 -0800 Subject: [PATCH] Log file status after copy for debugging --- cdp_backend/utils/file_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cdp_backend/utils/file_utils.py b/cdp_backend/utils/file_utils.py index 72d48657..cb4dbd7d 100644 --- a/cdp_backend/utils/file_utils.py +++ b/cdp_backend/utils/file_utils.py @@ -229,6 +229,7 @@ def resource_copy( # It was added because it's very common for SSL certs to be bad # See: https://github.com/CouncilDataProject/cdp-scrapers/pull/85 # And: https://github.com/CouncilDataProject/seattle/runs/5957646032 + with open(dst, "wb") as open_dst: open_dst.write( requests.get( @@ -237,6 +238,10 @@ def resource_copy( timeout=1800, ).content ) + log.info(f"File complete: {str(dst)}") + log.info(f"URI complete: {str(uri)}") + log.info(f"File exists: {dst.exists()}") + log.info(f"File stats: {dst.stat()}") else: # TODO: Add explicit use of GCS credentials until public read is fixed