forked from I2P_Developers/i2p.i2p
NetDB: Randomize explore and refresh job delays
This commit is contained in:
@ -40,7 +40,7 @@ class RefreshRoutersJob extends JobImpl {
|
||||
/** rerun fairly often. 1000 routers in 50 minutes
|
||||
* Don't go faster as this overloads the expl. OBEP / IBGW
|
||||
*/
|
||||
private final static long RERUN_DELAY_MS = 3*1000;
|
||||
private final static long RERUN_DELAY_MS = 2500;
|
||||
private final static long EXPIRE = 2*60*60*1000;
|
||||
private final static long NEW_LOOP_DELAY = 37*60*1000;
|
||||
private static final int ENOUGH_FFS = 3 * StartExplorersJob.LOW_FFS;
|
||||
@ -104,6 +104,6 @@ class RefreshRoutersJob extends JobImpl {
|
||||
}
|
||||
}
|
||||
}
|
||||
requeue(RERUN_DELAY_MS);
|
||||
requeue(RERUN_DELAY_MS + getContext().random().nextInt(1024));
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ class StartExplorersJob extends JobImpl {
|
||||
j.getTiming().setStartAfter(getContext().clock().now() + delay);
|
||||
getContext().jobQueue().addJob(j);
|
||||
// spread them out
|
||||
delay += 1250;
|
||||
delay += 1000 + getContext().random().nextInt(512);
|
||||
}
|
||||
}
|
||||
long delay = getNextRunDelay();
|
||||
|
Reference in New Issue
Block a user