Exemplo n.º 1
0
def removeOrphans(db, cache):
    if hasattr(cache, "removeOrphans"):
        r = cache.removeOrphans()
        logger.debug("Remove Orphans: %s %s", type(r), r)
        count = r["count"]
        size = r["size"]
        rounds = r["rounds"]
    else:
        count, size, rounds = Util.removeOrphans(db, cache)
    print "Removed %d orphans, for %s, in %d rounds" % (count, Util.fmtSize(size), rounds)
Exemplo n.º 2
0
def removeOrphans(db, cache):
    if hasattr(cache, 'removeOrphans'):
        r = cache.removeOrphans()
        logger.debug("Remove Orphans: %s %s", type(r), r)
        count = r['count']
        size = r['size']
        rounds = r['rounds']
    else:
        count, size, rounds = Util.removeOrphans(db, cache)
    print "Removed %d orphans, for %s, in %d rounds" % (count, Util.fmtSize(size), rounds)
Exemplo n.º 3
0
def removeOrphans(db, cache):
    if hasattr(cache, 'removeOrphans'):
        r = cache.removeOrphans()
        logger.debug("Remove Orphans: %s %s", type(r), r)
        count = r['count']
        size = r['size']
        rounds = r['rounds']
    else:
        count, size, rounds = Util.removeOrphans(db, cache)
    print "Removed %d orphans, for %s, in %d rounds" % (count, Util.fmtSize(size), rounds)
Exemplo n.º 4
0
def removeOrphans():
    db = getDB()
    host = session['host']
    cache = caches[host]
    count, size, rounds = Util.removeOrphans(db, cache)
    j = {
        'count': count,
        'size': size,
        'rounds': rounds,
    }
    return createResponse(j)
Exemplo n.º 5
0
def removeOrphans():
    db = getDB()
    host = session['host']
    cache = caches[host]
    count, size, rounds = Util.removeOrphans(db, cache)
    j = {
        'count': count,
        'size': size,
        'rounds': rounds,
    }
    return createResponse(j)