Purge TimerTasks in the ping timeout task. Fixes #70.
This commit is contained in:
parent
0701e80a52
commit
645e307acc
|
@ -23,6 +23,8 @@
|
|||
|
||||
package net.socialgamer.cah;
|
||||
|
||||
import java.util.Timer;
|
||||
|
||||
import net.socialgamer.cah.data.ConnectedUsers;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
@ -36,14 +38,17 @@ import com.google.inject.Inject;
|
|||
public class UserPing extends SafeTimerTask {
|
||||
|
||||
private final ConnectedUsers users;
|
||||
private final Timer globalTimer;
|
||||
|
||||
@Inject
|
||||
public UserPing(final ConnectedUsers users) {
|
||||
public UserPing(final ConnectedUsers users, final Timer globalTimer) {
|
||||
this.users = users;
|
||||
this.globalTimer = globalTimer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
users.checkForPingAndIdleTimeouts();
|
||||
globalTimer.purge();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue