Skip to content

Commit

Permalink
Merge pull request #417 from dandi/gh-405b
Browse files Browse the repository at this point in the history
upload(): Only yield first "validating" status to pyout
  • Loading branch information
yarikoptic authored Feb 23, 2021
2 parents 2dfe376 + 4cbfe0d commit a6d290a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dandi/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,18 @@ def process_path(path, relpath):
# Upload file
#
yield {"status": "uploading"}
validating = False
for r in client.iter_upload(ds_identifier, "draft", metadata, str(path)):
if r["status"] == "uploading":
uploaded_paths[str(path)]["size"] = r["current"]
yield r
yield r
elif r["status"] == "validating":
# Only yield the first "validating" status
if not validating:
yield r
validating = True
else:
yield r
yield {"status": "done"}

except Exception as exc:
Expand Down

0 comments on commit a6d290a

Please sign in to comment.