lukechampine / user

A CLI renter for Sia
MIT License
12 stars 2 forks source link

Inaccurate upload speeds #18

Closed lukechampine closed 4 years ago

lukechampine commented 4 years ago

Currently if you upload a small file with user upload, it will claim that it uploaded the whole file super fast, like 50MB/s or something. Then it will hang for a bit before exiting.

Of course, what's really happening is that the file was simply copied into the upload buffer super fast, and the hanging at the end is when the file was actually being uploaded.

Fortunately, there's an easy fix: just call Sync after each Write call, and treat each Write+Sync as one write when calculating the speed.