lib/getController.js
function teamOutAction() {
        sessionStore.get(sessionId, function aa(_error, expressSession) {
            if (!expressSession) {
                log(1, sessionId, 'Session has expired', nonObjTemplatelogLevel);
            }

            if (!expressSession ||
                cachedController.controller.__template__.objectTemplate.getPendingCallCount() === 0) {
                controllers[sessionId + path] = null;
                log(1, sessionId, 'Expiring controller cache for ' + path, nonObjTemplatelogLevel);
            }
            else {
                cachedController.timeout = setTimeout(timeoutAction, objectCacheExpiration);
                log(2, sessionId, 'Extending controller cache timeout because of pending calls for ' + path,
 -                    nonObjTemplatelogLevel);
            }
        });
    }
function teamOutAction() {
        sessionStore.get(sessionId, function aa(_error, expressSession) {
            if (!expressSession) {
                log(1, sessionId, 'Session has expired', nonObjTemplatelogLevel);
            }

            if (!expressSession ||
                cachedController.controller.__template__.objectTemplate.getPendingCallCount() === 0) {
                controllers[sessionId + path] = null;
                log(1, sessionId, 'Expiring controller cache for ' + path, nonObjTemplatelogLevel);
            }
            else {
                cachedController.timeout = setTimeout(timeoutAction, objectCacheExpiration);
                log(2, sessionId, 'Extending controller cache timeout because of pending calls for ' + path,
 -                    nonObjTemplatelogLevel);
            }
        });
    }
function teamOutAction ( ) { sessionStore . get ( sessionId , function aa ( _error , expressSession ) { if ( ! expressSession ) { log ( 1 , sessionId , 'Session has expired' , nonObjTemplatelogLevel ) ; } if ( ! expressSession || cachedController . controller . __template__ . objectTemplate . getPendingCallCount ( ) === 0 ) { controllers [ sessionId + path ] = null ; log ( 1 , sessionId , 'Expiring controller cache for ' + path , nonObjTemplatelogLevel ) ; } else { cachedController . timeout = setTimeout ( timeoutAction , objectCacheExpiration ) ; log ( 2 , sessionId , 'Extending controller cache timeout because of pending calls for ' + path , - nonObjTemplatelogLevel ) ; } } ) ; }
We cache the controller object which will reference the object template and expire it as long as there are no pending calls.  Note that with a memory store session manager the act of referencing the session will expire it if needed
We cache the controller object which will reference the object template and expire it as long as there are no pending calls . Note that with a memory store session manager the act of referencing the session will expire it if needed