~dobey/ubuntuone-client/no-more-notonlineerrors

« back to all changes in this revision

Viewing changes to ubuntuone/syncdaemon/local_rescan.py

Locally there're no more zero size files when waiting for be filled with a download.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        log_info("start scan all shares")
59
59
        to_scan = self._get_shares()
60
60
        for share in to_scan:
61
 
            mdobj = self.fsm.get_by_path(share.path)
62
 
            self._queue.appendleft((share, share.path, True, mdobj.mdid))
 
61
            try:
 
62
                mdobj = self.fsm.get_by_path(share.path)
 
63
            except KeyError:
 
64
                # this could happen in a strange corruption situation where FSM
 
65
                # lost the share information, so we remove it, because VM will
 
66
                # download it again
 
67
                self.vm.share_deleted(share.id)
 
68
            else:
 
69
                self._queue.appendleft((share, share.path, True, mdobj.mdid))
63
70
        d = self._queue_scan()
64
71
        d.addCallback(self._process_trash)
65
72
        return d