diff options
author | Simon Rettberg | 2023-07-11 11:26:00 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-07-11 11:26:00 +0200 |
commit | 0efd7374273f56dcc03e7c29f6c78aeb33082b48 (patch) | |
tree | 61254562c89553204f1698ae991d08ba9f0157ae /src/main/java/org/openslx/filetransfer/util/HashChecker.java | |
parent | [filetransfer] Also check meta data error string in Up-/Download loop (diff) | |
download | master-sync-shared-0efd7374273f56dcc03e7c29f6c78aeb33082b48.tar.gz master-sync-shared-0efd7374273f56dcc03e7c29f6c78aeb33082b48.tar.xz master-sync-shared-0efd7374273f56dcc03e7c29f6c78aeb33082b48.zip |
[filetransfer] Log when hashing/disk write is too slow
Diffstat (limited to 'src/main/java/org/openslx/filetransfer/util/HashChecker.java')
-rw-r--r-- | src/main/java/org/openslx/filetransfer/util/HashChecker.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/filetransfer/util/HashChecker.java b/src/main/java/org/openslx/filetransfer/util/HashChecker.java index f6f8876..41bd05a 100644 --- a/src/main/java/org/openslx/filetransfer/util/HashChecker.java +++ b/src/main/java/org/openslx/filetransfer/util/HashChecker.java @@ -137,7 +137,12 @@ public class HashChecker chunk.setStatus( ChunkStatus.HASHING ); } if ( blocking ) { + long pre = System.currentTimeMillis(); queue.put( task ); + long duration = System.currentTimeMillis() - pre; + if ( duration > 1000 ) { + LOGGER.warn( "HashChecker.queue() took " + duration + "ms" ); + } } else { if ( !queue.offer( task ) ) { return false; @@ -224,7 +229,7 @@ public class HashChecker public static enum HashResult { - NONE, // No hashing tool place + NONE, // No hashing took place VALID, // Hash matches INVALID, // Hash does not match FAILURE // Error calculating hash |