X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fapplication%2FProjectInserter.java;h=a7619512cb8af7e1776ff5c865d9f2e0d9d276a5;hb=0cffcea7c8788a104fb41c9ff55b53fd2aa99cb4;hp=3d2457bd872b11a3b3e8b05ab59998c6a993de13;hpb=6d1b6da5f904f15afc8e4982ae70fcbfea4307d7;p=jSite.git diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index 3d2457b..a761951 100644 --- a/src/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/de/todesbaum/jsite/application/ProjectInserter.java @@ -54,6 +54,9 @@ import de.todesbaum.util.io.StreamCopier; */ public class ProjectInserter implements FileScannerListener, Runnable { + /** Random number for FCP instances. */ + private static final int random = (int) (Math.random() * Integer.MAX_VALUE); + /** Counter for FCP connection identifier. */ private static int counter = 0; @@ -366,7 +369,7 @@ public class ProjectInserter implements FileScannerListener, Runnable { List files = fileScanner.getFiles(); /* create connection to node */ - Connection connection = freenetInterface.getConnection("project-insert-" + counter++); + Connection connection = freenetInterface.getConnection("project-insert-" + random + counter++); boolean connected = false; Throwable cause = null; try {