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)
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)
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)