forked from I2P_Developers/i2p.i2p
Console: Delay plugin update check until router is ready
This commit is contained in:
@ -173,14 +173,24 @@ public class PluginStarter implements Runnable {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (delay) {
|
if (delay) {
|
||||||
|
// wait for router.
|
||||||
|
// i2ptunnel won't start until isRunning()
|
||||||
|
int loop = 0;
|
||||||
|
while (!ctx.router().isRunning()) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(10*1000);
|
||||||
|
} catch (InterruptedException ie) { return; }
|
||||||
|
// 30 minutes
|
||||||
|
if (loop++ > 180) return;
|
||||||
|
}
|
||||||
// wait for proxy
|
// wait for proxy
|
||||||
mgr.update(TYPE_DUMMY, 3*60*1000);
|
mgr.update(TYPE_DUMMY, 3*60*1000);
|
||||||
mgr.notifyProgress(null, Messages.getString("Checking for plugin updates", ctx));
|
mgr.notifyProgress(null, Messages.getString("Checking for plugin updates", ctx));
|
||||||
int loop = 0;
|
loop = 0;
|
||||||
do {
|
do {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(5*1000);
|
Thread.sleep(5*1000);
|
||||||
} catch (InterruptedException ie) {}
|
} catch (InterruptedException ie) { break; }
|
||||||
if (loop++ > 40) break;
|
if (loop++ > 40) break;
|
||||||
} while (mgr.isUpdateInProgress(TYPE_DUMMY));
|
} while (mgr.isUpdateInProgress(TYPE_DUMMY));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user