forked from External/mage
* Some changes to chat and user handling.
This commit is contained in:
parent
52897094b3
commit
d024d59626
3 changed files with 13 additions and 13 deletions
|
|
@ -86,19 +86,17 @@ public enum ChatManager {
|
|||
if (chatId != null) {
|
||||
ChatSession chatSession = chatSessions.get(chatId);
|
||||
if (chatSession != null) {
|
||||
synchronized (chatSession) {
|
||||
if (chatSessions.containsKey(chatId)) {
|
||||
final Lock w = lock.writeLock();
|
||||
w.lock();
|
||||
try {
|
||||
chatSessions.remove(chatId);
|
||||
} finally {
|
||||
w.unlock();
|
||||
}
|
||||
logger.trace("Chat removed - chatId: " + chatId);
|
||||
} else {
|
||||
logger.trace("Chat to destroy does not exist - chatId: " + chatId);
|
||||
if (chatSessions.containsKey(chatId)) {
|
||||
final Lock w = lock.writeLock();
|
||||
w.lock();
|
||||
try {
|
||||
chatSessions.remove(chatId);
|
||||
} finally {
|
||||
w.unlock();
|
||||
}
|
||||
logger.trace("Chat removed - chatId: " + chatId);
|
||||
} else {
|
||||
logger.trace("Chat to destroy does not exist - chatId: " + chatId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue