Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish between pre- and post-validation when uploading #420

Merged
merged 1 commit into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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