Merge pull request #572 from bigbluebutton/fix-issue-1898

- fix https://code.google.com/p/bigbluebutton/issues/detail?id=1898
This commit is contained in:
Fred Dixon 2015-03-18 19:54:23 -04:00
commit 423ffdeffa

View File

@ -64,6 +64,8 @@ public class Meeting {
private final ConcurrentMap<String, User> users;
private final ConcurrentMap<String, Config> configs;
private long lastUserLeftOn = 0;
public Meeting(Builder builder) {
name = builder.name;
extMeetingId = builder.externalId;
@ -239,7 +241,9 @@ public class Meeting {
}
public User userLeft(String userid){
return users.remove(userid);
User u = (User) users.remove(userid);
if (users.isEmpty()) lastUserLeftOn = System.currentTimeMillis();
return u;
}
public User getUserById(String id){
@ -284,7 +288,7 @@ public class Meeting {
private boolean hasBeenEmptyFor(int expiry) {
long now = System.currentTimeMillis();
return (now - endTime > (expiry * MILLIS_IN_A_MINUTE));
return (now - lastUserLeftOn > (expiry * MILLIS_IN_A_MINUTE));
}
private boolean isEmpty() {