def fill_remote_cache(cache):
    remote_cache_time_start = get_remote_cache_time()
    remote_cache_requests_start = get_remote_cache_requests()
    items_for_remote_cache = {} # type: Dict[str, Any]
    (objects, items_filler, timeout, batch_size) = cache_fillers[cache]
    count = 0
    for obj in objects():
        items_filler(items_for_remote_cache, obj)
        count += 1
        if (count % batch_size == 0):
            cache_set_many(items_for_remote_cache, timeout=3600*24)
            items_for_remote_cache = {}
    cache_set_many(items_for_remote_cache, timeout=3600*24*7)
    logging.info("Succesfully populated %s cache!  Consumed %s remote cache queries (%s time)" % \
                     (cache, get_remote_cache_requests() - remote_cache_requests_start,
                      round(get_remote_cache_time() - remote_cache_time_start, 2)))
dataset/ETHPy150Open zulip/zulip/zerver/lib/cache_helpers.py/fill_remote_cache/original