From 14ea6d8d0aff783f8318f2067634c2e388a8b4e3 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Sat, 19 Oct 2013 14:47:27 +0000 Subject: [PATCH] delay multiple ExploreJobs slightly --- .../i2p/router/networkdb/kademlia/StartExplorersJob.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/StartExplorersJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/StartExplorersJob.java index 49198ad9f6..8b4e05b4f7 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/StartExplorersJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/StartExplorersJob.java @@ -62,8 +62,13 @@ class StartExplorersJob extends JobImpl { if (_log.shouldLog(Log.DEBUG)) _log.debug("Keys to explore during this run: " + toExplore); _facade.removeFromExploreKeys(toExplore); + long delay = 0; for (Hash key : toExplore) { - getContext().jobQueue().addJob(new ExploreJob(getContext(), _facade, key)); + ExploreJob j = new ExploreJob(getContext(), _facade, key); + if (delay > 0) + j.getTiming().setStartAfter(getContext().clock().now() + delay); + getContext().jobQueue().addJob(j); + delay += 200; } } long delay = getNextRunDelay(); -- GitLab