debug DownloadWorker.java
This commit is contained in:
@@ -20,13 +20,15 @@ public class DownloadWorker implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long start = System.currentTimeMillis();
|
||||
chunkStatus.setStartTimeMs(start);
|
||||
|
||||
chunkStatus.setStartTimeMs(System.currentTimeMillis());
|
||||
|
||||
double downloaded = 0.0;
|
||||
|
||||
System.out.println(
|
||||
"Chunk (id: " + chunkStatus.getChunkId() + ") has started downloading."
|
||||
"[Worker-" + chunkStatus.getChunkId() +
|
||||
"] Started downloading chunk of size: " +
|
||||
String.format("%.2f", chunkStatus.getChunkSizeMB()) + " MB"
|
||||
);
|
||||
|
||||
while (downloaded < chunkStatus.getChunkSizeMB()) {
|
||||
@@ -38,7 +40,9 @@ public class DownloadWorker implements Runnable {
|
||||
|
||||
try {
|
||||
Thread.sleep(randomSleepDelay);
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
|
||||
Thread.currentThread().interrupt();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user