IDEMPIERE-5049 Zk Session and Desktop object not destroy immediately after logout (#1151)

Fix "zkoss.removeDesktop:70: Removing non-existent desktop: [Desktop
z_7zm:/index.zul]" warning at server log.
This commit is contained in:
hengsin 2022-01-28 22:27:38 +08:00 committed by GitHub
parent 7689183b49
commit 8780884ef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -192,10 +192,16 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
//clear context, invalidate session
Env.getCtx().clear();
Adempiere.getThreadPoolExecutor().schedule(() -> {
((SessionCtrl)session).invalidateNow();
desktop.setAttribute(DESKTOP_SESSION_INVALIDATED_ATTR, Boolean.TRUE);
try {
desktopCache.removeDesktop(desktop);
try {
((SessionCtrl)session).invalidateNow();
} catch (Throwable t) {
t.printStackTrace();
}
try {
if (desktopCache.getDesktopIfAny(desktop.getId()) != null) {
desktop.setAttribute(DESKTOP_SESSION_INVALIDATED_ATTR, Boolean.TRUE);
desktopCache.removeDesktop(desktop);
}
} catch (Throwable t) {
t.printStackTrace();
}