mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
Pattern fix.
This commit is contained in:
parent
f56c26ad2b
commit
c8b4500f1d
1 changed files with 2 additions and 2 deletions
|
@ -9,7 +9,7 @@
|
||||||
public class SessionManager implements NeedGarbageCollection {
|
public class SessionManager implements NeedGarbageCollection {
|
||||||
|
|
||||||
public static final long SESSION_TIMEOUT = 10 * 60 * 1000; // 10 минут
|
public static final long SESSION_TIMEOUT = 10 * 60 * 1000; // 10 минут
|
||||||
public static final boolean GARBAGE_SERVER = Boolean.parseBoolean(System.getProperty("launcher.garbage.sessions", "false"));
|
public static final boolean GARBAGE_SERVER = Boolean.parseBoolean(System.getProperty("launcher.garbageSessionsServer", "false"));
|
||||||
private HashSet<Client> clientSet = new HashSet<>(128);
|
private HashSet<Client> clientSet = new HashSet<>(128);
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ public boolean addClient(Client client) {
|
||||||
@Override
|
@Override
|
||||||
public void garbageCollection() {
|
public void garbageCollection() {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
clientSet.removeIf(c -> (c.timestamp + SESSION_TIMEOUT < time) && (c.type == Client.Type.USER) && GARBAGE_SERVER);
|
clientSet.removeIf(c -> (c.timestamp + SESSION_TIMEOUT < time) && ((c.type == Client.Type.USER) || ((c.type == Client.Type.SERVER) && GARBAGE_SERVER)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue