diff options
| -rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java | 4 |
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(); |
