Skip to content

Commit 2ba4c2d

Browse files
authored
Merge pull request #152 from statisticsnorway/bug-check-size-from-archive
Fix bug where the filesize check fails when import from archive
2 parents 81accf3 + d7560b3 commit 2ba4c2d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

job_executor/adapter/local_storage.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,13 @@ def delete_archived_input(dataset_name: str):
428428
def get_input_tar_size_in_bytes(dataset_name: str) -> int:
429429
"""
430430
Checks the size in bytes of the dataset.tar file.
431-
returns size in bytes
431+
Returns size in bytes or 0 if the file does not exist.
432432
"""
433433
tar_path = INPUT_DIR / f"{dataset_name}.tar"
434+
434435
if not tar_path.exists():
435-
return 0
436-
return os.path.getsize(tar_path)
436+
tar_path = INPUT_DIR / "archive" / f"{dataset_name}.tar"
437+
438+
if tar_path.exists():
439+
return os.path.getsize(tar_path)
440+
return 0

0 commit comments

Comments
 (0)