Skip to content

Commit e7d44f6

Browse files
committed
enh: improved resource availability check
1 parent 664bdee commit e7d44f6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
0.12.3
2+
- enh: improved resource availability check
13
0.12.2
24
- fix: testing did not append S3 resources
35
0.12.1

dcor_shared/data.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import time
55

66
from .ckan import get_resource_path
7+
from . import s3cc
78

89

910
#: Content of the dummy file created when importing data.
@@ -68,8 +69,11 @@ def wait_for_resource(resource_id: str,
6869
continue
6970

7071
s3_ok = res_dict.get("s3_available", None)
71-
if s3_ok is not None:
72-
# If the dataset is on S3, it is considered to be available.
72+
if s3_ok:
73+
# If the resource is on S3, it is considered to be available.
74+
break
75+
elif s3cc.artifact_exists(res_dict["id"]):
76+
# It is on S3, but not yet registered. That's fine.
7377
break
7478
elif time.time() - t0 > timeout:
7579
raise OSError("Data import seems to take too long "

0 commit comments

Comments
 (0)