debug DownloadWorker.java

This commit is contained in:
2026-06-08 11:46:12 +03:30
parent 5fdcd9349c
commit a7fbc21be9
+7 -3
View File
@@ -20,13 +20,15 @@ public class DownloadWorker implements Runnable {
@Override @Override
public void run() { public void run() {
long start = System.currentTimeMillis();
chunkStatus.setStartTimeMs(start); chunkStatus.setStartTimeMs(System.currentTimeMillis());
double downloaded = 0.0; double downloaded = 0.0;
System.out.println( 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()) { while (downloaded < chunkStatus.getChunkSizeMB()) {
@@ -38,7 +40,9 @@ public class DownloadWorker implements Runnable {
try { try {
Thread.sleep(randomSleepDelay); Thread.sleep(randomSleepDelay);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
return; return;
} }