mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Check speed doesn't become infinite because command duration was too low.
This commit is contained in:
@@ -277,8 +277,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dumpLog.WriteLine("Error reading {0} blocks from block {1}.", blocksToRead, i);
|
||||
}
|
||||
|
||||
currentSpeed = (double)blockSize * blocksToRead / 1048576 / (duration / 1000);
|
||||
GC.Collect();
|
||||
double newSpeed = (double)blockSize * blocksToRead / 1048576 / (duration / 1000);
|
||||
if(!double.IsInfinity(newSpeed)) currentSpeed = newSpeed;
|
||||
resume.NextBlock = i + blocksToRead;
|
||||
}
|
||||
|
||||
@@ -394,8 +394,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dumpFile.Write(new byte[blockSize]);
|
||||
}
|
||||
|
||||
currentSpeed = blockSize / (double)1048576 / (duration / 1000);
|
||||
GC.Collect();
|
||||
double newSpeed = blockSize / (double)1048576 / (duration / 1000);
|
||||
if(!double.IsInfinity(newSpeed)) currentSpeed = newSpeed;
|
||||
|
||||
currentBlock++;
|
||||
}
|
||||
@@ -439,7 +439,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
double chkDuration = (chkEnd - chkStart).TotalMilliseconds;
|
||||
totalChkDuration += chkDuration;
|
||||
|
||||
currentSpeed = (double)blockSize * blocksToRead / 1048576 / (chkDuration / 1000);
|
||||
double newSpeed = (double)blockSize * blocksToRead / 1048576 / (chkDuration / 1000);
|
||||
if(!double.IsInfinity(newSpeed)) currentSpeed = newSpeed;
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
|
||||
Reference in New Issue
Block a user