Skip to content

Commit

Permalink
Distinguish between pre- and post-validation when uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Feb 24, 2021
1 parent fc5de49 commit 71619d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dandi/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def iter_upload(self, dandiset_id, version_id, asset_metadata, filepath):
)
break
before_time = monotonic()
yield {"status": "validating"}
yield {"status": "post-validating"}
after_time = monotonic()
if after_time - before_time < s:
sleep(s - (after_time - before_time))
Expand Down
8 changes: 4 additions & 4 deletions dandi/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def ensure_folder():
#
# TODO: enable back validation of dandiset.yaml
if path.name != dandiset_metadata_file and validation != "skip":
yield {"status": "validating"}
yield {"status": "pre-validating"}
validation_errors = validate_file(path)
yield {"errors": len(validation_errors)}
# TODO: split for dandi, pynwb errors
Expand Down Expand Up @@ -733,7 +733,7 @@ def process_path(path, relpath):
#
# TODO: enable back validation of dandiset.yaml
if path.name != dandiset_metadata_file and validation != "skip":
yield {"status": "validating"}
yield {"status": "pre-validating"}
validation_errors = validate_file(path)
yield {"errors": len(validation_errors)}
# TODO: split for dandi, pynwb errors
Expand Down Expand Up @@ -804,8 +804,8 @@ def process_path(path, relpath):
if r["status"] == "uploading":
uploaded_paths[str(path)]["size"] = r["current"]
yield r
elif r["status"] == "validating":
# Only yield the first "validating" status
elif r["status"] == "post-validating":
# Only yield the first "post-validating" status
if not validating:
yield r
validating = True
Expand Down

0 comments on commit 71619d3

Please sign in to comment.