function expiration() {
        const now = ~~(Date.now() / 1000); // unix timestamp
        const { list, removeList } = _.reduce(
            messagesCached,
            (acc, message = {}) => {
                const { ExpirationTime } = message;
                const test = !(ExpirationTime !== 0 && ExpirationTime < now);
                const key = test ? 'list' : 'removeList';
                acc[key].push(message);
                return acc;
            },
            { list: [], removeList: [] }
        );

        messagesCached = list;
        removeList.length && dispatcher['message.expiration']();
    }
/**
     * Manage expiration time for messages in the cache
     */
Manage expiration time for messages in the cache
Manage expiration time for messages in the cache
function expiration() {
        const now = ~~(Date.now() / 1000); 
        const { list, removeList } = _.reduce(
            messagesCached,
            (acc, message = {}) => {
                const { ExpirationTime } = message;
                const test = !(ExpirationTime !== 0 && ExpirationTime < now);
                const key = test ? 'list' : 'removeList';
                acc[key].push(message);
                return acc;
            },
            { list: [], removeList: [] }
        );
        messagesCached = list;
        removeList.length && dispatcher['message.expiration']();
    }
function expiration ( ) { const now = ~ ~ ( Date . now ( ) / 1000 ) ; const { list , removeList } = _ . reduce ( messagesCached , ( acc , message = { } ) => { const { ExpirationTime } = message ; const test = ! ( ExpirationTime !== 0 && ExpirationTime < now ) ; const key = test ? 'list' : 'removeList' ; acc [ key ] . push ( message ) ; return acc ; } , { list : [ ] , removeList : [ ] } ) ; messagesCached = list ; removeList . length && dispatcher [ 'message.expiration' ] ( ) ; }
Manage expiration time for messages in the cache
Manage expiration time for messages in the cache
// unix timestamp