Commit 140a0d6e authored by Tobias Assmann's avatar Tobias Assmann
Browse files

fix session cleanup handling

parent f7e3399f
......@@ -76,9 +76,14 @@ public class SessionStore {
sessionLifeTime.cancel();
}
private boolean isExpired(Session s) {
return s.getLastAccess().plus(maxAge).isAfter(Instant.now());
}
private boolean isExpired(Session s) {
Instant now = Instant.now();
Instant la = s.getLastAccess();
Instant edge = la.plus(maxAge);
boolean retVal = edge.isBefore(now);
return retVal;
}
private synchronized void removeExpired() {
ArrayList<String> toRemove = new ArrayList<>();
......
......@@ -88,9 +88,14 @@ public class SessionStore {
sessionLifeTime.cancel();
}
private boolean isExpired(Session s) {
return s.getLastAccess().plus(maxAge).isAfter(Instant.now());
}
private boolean isExpired(Session s) {
Instant now = Instant.now();
Instant la = s.getLastAccess();
Instant edge = la.plus(maxAge);
boolean retVal = edge.isBefore(now);
return retVal;
}
private synchronized void removeExpired() {
ArrayList<String> toRemove = new ArrayList<>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment