Method
pace
(long started, long sentBytes)
Source from the content-addressed store, hash-verified
| 151 | } |
| 152 | |
| 153 | private static void pace(long started, long sentBytes) throws InterruptedException { |
| 154 | long remaining = sentBytes * 1000000000L / INPUT_BYTES_PER_SECOND - (System.nanoTime() - started); |
| 155 | if (remaining > 0) TimeUnit.NANOSECONDS.sleep(remaining); |
| 156 | } |
| 157 | |
| 158 | private static void checkFailure(AtomicReference<Throwable> failure) { |
| 159 | Throwable cause = failure.get(); |
Tested by
no test coverage detected