Skip to content

Commit 5fc13a6

Browse files
author
Alex Huang
committed
There's no background thread working on maintaining the connections
1 parent e4967c4 commit 5fc13a6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎utils/src/com/cloud/utils/db/ConnectionConcierge.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public String resetKeepAliveTask(int seconds) {
203203
}
204204

205205
_executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("ConnectionConcierge"));
206-
_executor.schedule(new Runnable() {
206+
_executor.scheduleAtFixedRate(new Runnable() {
207207
@Override
208208
public void run() {
209209
s_logger.trace("connection concierge keep alive task");
@@ -214,7 +214,7 @@ public void run() {
214214
}
215215
}
216216
}
217-
}, seconds, TimeUnit.SECONDS);
217+
}, 0, seconds, TimeUnit.SECONDS);
218218

219219
return "As you wish.";
220220
}

‎utils/src/com/cloud/utils/time/InaccurateClock.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public InaccurateClock() {
5252
public synchronized String restart() {
5353
turnOff();
5454
s_executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("InaccurateClock"));
55-
s_executor.schedule(new SetTimeTask(), 60, TimeUnit.SECONDS);
55+
s_executor.scheduleAtFixedRate(new SetTimeTask(), 0, 60, TimeUnit.SECONDS);
5656
return "Restarted";
5757
}
5858

0 commit comments

Comments
 (0)