bennyxqg / bulk-loader

Automatically exported from code.google.com/p/bulk-loader
0 stars 0 forks source link

getProgressForItems return NaN for weightPercent until every item has begun loading #106

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
easy fix:

localWeightLoaded += (item._bytesLoaded / item._bytesTotal) * item.weight;

>>>

if (item._bytesTotal) localWeightLoaded += (item._bytesLoaded /
item._bytesTotal) * item.weight;

Original issue reported on code.google.com by fumanch...@gmail.com on 21 Oct 2009 at 11:44

GoogleCodeExporter commented 9 years ago
Hi Fumanchu.

There is definitely something fishy with this, because I cannot reproduce the 
problem at 
all here.
Can you post the minimal test case (if possible with the online urls for the 
issue) that 
will cause it? I can then take a look and see what's wrong.

Thanks

Original comment by debert on 23 Oct 2009 at 1:55

GoogleCodeExporter commented 9 years ago
sorry wrong scenario: it happens only on 0-byte file loading and i didn't see 
that
one of my PHP scripts returned nothing

it's still a bad idea to divide by something that can be 0 :)

Original comment by fumanch...@gmail.com on 28 Oct 2009 at 4:19

GoogleCodeExporter commented 9 years ago
This is fixed in revision 311.

Regards

Original comment by debert on 31 Oct 2009 at 5:24