Skip to content

Commit e1eca82

Browse files
committed
Don't check size when updating resources - just check hash
1 parent 54a49d9 commit e1eca82

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

src/hdx/api/utilities/filestore_helper.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,7 @@ def dataset_update_filestore_resource(
112112
force_update = kwargs.pop("force_update", False)
113113
file_format = resource_data_to_update.get("format", "").lower()
114114
size, hash = get_size_and_hash(file_to_upload, file_format)
115-
if (
116-
not force_update
117-
and size == original_resource_data.get("size")
118-
and hash == original_resource_data.get("hash")
119-
):
115+
if not force_update and hash == original_resource_data.get("hash"):
120116
logger.warning(
121117
f"Not updating filestore for resource {original_resource_data['name']} as size and hash unchanged!"
122118
)

src/hdx/data/resource.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,7 @@ def _resource_merge_hdx_update(
415415
force_update = kwargs.pop("force_update", False)
416416
file_format = self._old_data.get("format", "").lower()
417417
size, hash = get_size_and_hash(self._file_to_upload, file_format)
418-
if (
419-
not force_update
420-
and size == self.data.get("size")
421-
and hash == self.data.get("hash")
422-
):
418+
if not force_update and hash == self.data.get("hash"):
423419
logger.warning(
424420
f"Not updating filestore for resource {self.data['name']} as size and hash unchanged!"
425421
)

0 commit comments

Comments
 (0)