summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java
diff options
context:
space:
mode:
authorSimon Rettberg2015-10-05 14:10:23 +0200
committerSimon Rettberg2015-10-05 14:10:23 +0200
commitc98d781d4e7925cf015c68c3c2987486cdaaf6b3 (patch)
treed44ed8ca19c918590f23b3e79341a2c8d410888b /dozentenmodul/src/main/java
parent[client] FORGOT THIS FILE HERE! (diff)
downloadtutor-module-c98d781d4e7925cf015c68c3c2987486cdaaf6b3.tar.gz
tutor-module-c98d781d4e7925cf015c68c3c2987486cdaaf6b3.tar.xz
tutor-module-c98d781d4e7925cf015c68c3c2987486cdaaf6b3.zip
[client] Slower hashing when upload not running yet
Diffstat (limited to 'dozentenmodul/src/main/java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java
index a05ab370..b5e9cb60 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java
@@ -81,6 +81,10 @@ public class AsyncHashGenerator extends Thread {
break;
try {
checker.put(block);
+ // Don't hash too furiously in the background if the upload didn't start yet
+ if (uploadToken != null && chunk.range.startOffset > FileChunk.CHUNK_SIZE * 2) {
+ Util.sleep(200);
+ }
} catch (InterruptedException e) {
LOGGER.info("Reader thread for hash checking got interrupted", e);
interrupt();