private static int getTimeout(final Ticket ticket) {
        val timeToLive = ticket.getExpirationPolicy().getTimeToLive();
        var ttl = Long.MAX_VALUE == timeToLive ? Long.valueOf(Integer.MAX_VALUE) : timeToLive;
        if (ttl == 0) {
            return 1;
        }
        if (ttl >= THIRTY_DAYS_IN_SECONDS) {
            LOGGER.warn("Time-to-live value [{}] is greater than or equal to [{}]", ttl, THIRTY_DAYS_IN_SECONDS);
            return THIRTY_DAYS_IN_SECONDS;
        }
        return ttl.intValue();
    }
If not time out value is specified, expire the ticket immediately.

@param ticket the ticket
@return timeout in milliseconds.
support/cas-server-support-memcached-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/MemcachedTicketRegistry.java