Ejemplo n.º 1
0
def get_online_users(guest=False):  # pragma: no cover
    """Returns all online users within a specified time range

    :param guest: If True, it will return the online guests
    """
    current = int(time.time()) // 60
    minutes = range_method(flaskbb_config["ONLINE_LAST_MINUTES"])
    if guest:
        return redis_store.sunion(["online-guests/%d" % (current - x) for x in minutes])
    return redis_store.sunion(["online-users/%d" % (current - x) for x in minutes])
Ejemplo n.º 2
0
def get_online_users(guest=False):  # pragma: no cover
    """Returns all online users within a specified time range

    :param guest: If True, it will return the online guests
    """
    current = int(time.time()) // 60
    minutes = range_method(flaskbb_config['ONLINE_LAST_MINUTES'])
    if guest:
        return redis_store.sunion(
            ['online-guests/%d' % (current - x) for x in minutes])
    return redis_store.sunion(
        ['online-users/%d' % (current - x) for x in minutes])