def total_images():
    r = redis.StrictRedis(host=REDIS_ADDR, port=REDIS_PORT, db=REDIS_DB, decode_responses=True)
    total = r.get('IMG_TOTAL')
    if (not total):
        r.set('IMG_TOTAL', 0)
        return 0
    return int(total)
def total_images():
    r = redis.StrictRedis(host=REDIS_ADDR, port=REDIS_PORT, db=REDIS_DB, decode_responses=True)
    total = r.get('IMG_TOTAL')
    if (not total):
        r.set('IMG_TOTAL', 0)
        return 0
    return int(total)