Skip to content

Commit

Permalink
Fixes dwdyer#18
Browse files Browse the repository at this point in the history
Make random.org requests in a static synchronized method, since random.org doesn't allow multiple requests in parallel.
  • Loading branch information
Pr0methean committed Jul 27, 2017
1 parent 64911c6 commit 4fa3406
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public byte[] generateSeed(int length) throws SeedException
* is greater than that permitted by random.org for a single request.
* @throws IOException If there is a problem downloading the random bits.
*/
private void refreshCache(int requiredBytes) throws IOException
private static synchronized void refreshCache(int requiredBytes) throws IOException
{
int numberOfBytes = Math.max(requiredBytes, cache.length);
numberOfBytes = Math.min(numberOfBytes, MAX_REQUEST_SIZE);
Expand Down

0 comments on commit 4fa3406

Please sign in to comment.