forked from I2P_Developers/i2p.i2p
Add min delay after startup before fetching news
This commit is contained in:
@ -92,8 +92,11 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
|
|||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final long INITIAL_DELAY = 5*60*1000;
|
||||||
|
private static final long RUN_DELAY = 10*60*1000;
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
try { Thread.sleep(_context.random().nextLong(5*60*1000)); } catch (InterruptedException ie) {}
|
try { Thread.sleep(INITIAL_DELAY + _context.random().nextLong(INITIAL_DELAY)); } catch (InterruptedException ie) {}
|
||||||
while (true) {
|
while (true) {
|
||||||
if (!_updateAvailable) checkForUpdates();
|
if (!_updateAvailable) checkForUpdates();
|
||||||
if (shouldFetchNews()) {
|
if (shouldFetchNews()) {
|
||||||
@ -101,7 +104,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
|
|||||||
if (shouldFetchUnsigned())
|
if (shouldFetchUnsigned())
|
||||||
fetchUnsignedHead();
|
fetchUnsignedHead();
|
||||||
}
|
}
|
||||||
try { Thread.sleep(10*60*1000); } catch (InterruptedException ie) {}
|
try { Thread.sleep(RUN_DELAY); } catch (InterruptedException ie) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user