forked from I2P_Developers/i2p.i2p
#1069: Deprecated SimpleScheduler and moved functionality into SimpleTimer2
This commit is contained in:
@@ -193,7 +193,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
// handled inside P.U.H. for now
|
||||
//register((Updater)puh, PLUGIN, FILE, 0);
|
||||
new NewsTimerTask(_context, this);
|
||||
_context.simpleScheduler().addPeriodicEvent(new TaskCleaner(), TASK_CLEANER_TIME);
|
||||
_context.simpleTimer2().addPeriodicEvent(new TaskCleaner(), TASK_CLEANER_TIME);
|
||||
changeState(RUNNING);
|
||||
if (_cmgr != null)
|
||||
_cmgr.register(this);
|
||||
@@ -1397,7 +1397,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
|
||||
private void finishStatus(String msg) {
|
||||
updateStatus(msg);
|
||||
_context.simpleScheduler().addEvent(new StatusCleaner(msg), STATUS_CLEAN_TIME);
|
||||
_context.simpleTimer2().addEvent(new StatusCleaner(msg), STATUS_CLEAN_TIME);
|
||||
}
|
||||
|
||||
private class StatusCleaner implements SimpleTimer.TimedEvent {
|
||||
|
@@ -38,7 +38,7 @@ class NewsTimerTask implements SimpleTimer.TimedEvent {
|
||||
delay += _context.random().nextLong(INITIAL_DELAY);
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Scheduling first news check in " + DataHelper.formatDuration(delay));
|
||||
ctx.simpleScheduler().addPeriodicEvent(this, delay, RUN_DELAY);
|
||||
ctx.simpleTimer2().addPeriodicEvent(this, delay, RUN_DELAY);
|
||||
// UpdateManager calls NewsFetcher to check the existing news at startup
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user