Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)