mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* User manager added some debug messages, changed remove player logic.
This commit is contained in:
parent
756e75d9e4
commit
50e82ef930
1 changed files with 7 additions and 1 deletions
|
@ -27,8 +27,10 @@
|
|||
*/
|
||||
package mage.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Executors;
|
||||
|
@ -59,7 +61,9 @@ public class UserManager {
|
|||
expireExecutor.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
logger.debug("Check expired start");
|
||||
checkExpired();
|
||||
logger.debug("Check expired end");
|
||||
}
|
||||
}, 60, 60, TimeUnit.SECONDS);
|
||||
}
|
||||
|
@ -149,7 +153,9 @@ public class UserManager {
|
|||
private void checkExpired() {
|
||||
Calendar expired = Calendar.getInstance();
|
||||
expired.add(Calendar.MINUTE, -3) ;
|
||||
for (User user: users.values()) {
|
||||
List<User> usersToCheck = new ArrayList<>();
|
||||
usersToCheck.addAll(users.values());
|
||||
for (User user: usersToCheck) {
|
||||
if (user.isExpired(expired.getTime())) {
|
||||
logger.info(new StringBuilder(user.getName()).append(" session expired userId: ").append(user.getId())
|
||||
.append(" sessionId: ").append(user.getSessionId()));
|
||||
|
|
Loading…
Reference in a new issue