Beispiel #1
0
def retrieve_saved_g_metadata(crispin_client, db_session, log, folder_name,
                              local_uids, saved_validity, syncmanager_lock):
    log.info('Attempting to retrieve remote_g_metadata from cache')

    update_uid_count = 0
    remote_g_metadata = get_cache(remote_g_metadata_cache_file(
        crispin_client.account_id, folder_name))

    if remote_g_metadata is not None:
        # Rebuild namedtuples because msgpack
        remote_g_metadata = {k: GMetadata(*v) for k, v in
                             remote_g_metadata.iteritems()}

        log.info('successfully retrieved remote_g_metadata cache',
                 object_count=len(remote_g_metadata))
        if crispin_client.selected_highestmodseq > \
                saved_validity.highestmodseq:
            update_uid_count = update_saved_g_metadata(crispin_client,
                                                       db_session, log,
                                                       folder_name,
                                                       remote_g_metadata,
                                                       local_uids,
                                                       syncmanager_lock)
    else:
        log.info("No cached data found")
    return remote_g_metadata, update_uid_count
Beispiel #2
0
def retrieve_saved_g_metadata(crispin_client, db_session, log, folder_name,
        local_uids, saved_validity, c):
    log.info('Attempting to retrieve remote_g_metadata from cache')
    remote_g_metadata = get_cache(remote_g_metadata_cache_file(
        crispin_client.account_id, folder_name))
    if remote_g_metadata is not None:
        log.info("Successfully retrieved remote_g_metadata cache")
        if crispin_client.selected_highestmodseq > \
                saved_validity.highestmodseq:
            update_saved_g_metadata(crispin_client, db_session, log,
                    folder_name, remote_g_metadata, local_uids, c)
    else:
        log.info("No cached data found")
    return remote_g_metadata
Beispiel #3
0
    def __retrieve_saved_g_metadata(self, crispin_client, local_uids,
                                    saved_highestmodseq):
        log.info('Attempting to retrieve remote_g_metadata from cache')

        remote_g_metadata = get_cache(remote_g_metadata_cache_file(
            crispin_client.account_id, self.folder_name))

        if remote_g_metadata is not None:
            # Rebuild namedtuples because msgpack
            remote_g_metadata = {k: GMetadata(*v) for k, v in
                                 remote_g_metadata.iteritems()}

            log.info('successfully retrieved remote_g_metadata cache',
                     object_count=len(remote_g_metadata))
            if crispin_client.selected_highestmodseq > saved_highestmodseq:
                self.__update_saved_g_metadata(crispin_client,
                                               remote_g_metadata, local_uids)
        else:
            log.info("No cached data found")
        return remote_g_metadata
Beispiel #4
0
def retrieve_saved_g_metadata(crispin_client, db_session, log, folder_name,
                              local_uids, saved_validity, syncmanager_lock):
    log.info('Attempting to retrieve remote_g_metadata from cache')
    remote_g_metadata = get_cache(remote_g_metadata_cache_file(
        crispin_client.account_id, folder_name))

    if remote_g_metadata is not None:
        # Rebuild namedtuples because msgpack
        remote_g_metadata = {k: GMetadata(*v) for k, v in
                             remote_g_metadata.iteritems()}

        log.info("Successfully retrieved remote_g_metadata cache "
                 "with {0} objects".format(len(remote_g_metadata)))
        if crispin_client.selected_highestmodseq > \
                saved_validity.highestmodseq:
            update_saved_g_metadata(crispin_client, db_session, log,
                                    folder_name, remote_g_metadata, local_uids,
                                    syncmanager_lock)
    else:
        log.info("No cached data found")
    return remote_g_metadata
Beispiel #5
0
def retrieve_saved_g_metadata(crispin_client, log, folder_name, local_uids,
                              saved_highestmodseq, syncmanager_lock):
    log.info('Attempting to retrieve remote_g_metadata from cache')

    update_uid_count = 0
    remote_g_metadata = get_cache(remote_g_metadata_cache_file(
        crispin_client.account_id, folder_name))

    if remote_g_metadata is not None:
        # Rebuild namedtuples because msgpack
        remote_g_metadata = {k: GMetadata(*v) for k, v in
                             remote_g_metadata.iteritems()}

        log.info('successfully retrieved remote_g_metadata cache',
                 object_count=len(remote_g_metadata))
        if crispin_client.selected_highestmodseq > saved_highestmodseq:
            update_uid_count = update_saved_g_metadata(
                crispin_client, log, folder_name, remote_g_metadata,
                local_uids, syncmanager_lock)
    else:
        log.info("No cached data found")
    return remote_g_metadata, update_uid_count