本文整理匯總了Python中pydio.job.localdb.LocalDbHandler.update_bulk_node_status_as_idle方法的典型用法代碼示例。如果您正苦於以下問題:Python LocalDbHandler.update_bulk_node_status_as_idle方法的具體用法?Python LocalDbHandler.update_bulk_node_status_as_idle怎麽用?Python LocalDbHandler.update_bulk_node_status_as_idle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pydio.job.localdb.LocalDbHandler
的用法示例。
在下文中一共展示了LocalDbHandler.update_bulk_node_status_as_idle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ContinuousDiffMerger
# 需要導入模塊: from pydio.job.localdb import LocalDbHandler [as 別名]
# 或者: from pydio.job.localdb.LocalDbHandler import update_bulk_node_status_as_idle [as 別名]
#.........這裏部分代碼省略.........
logging.info('No changes detected in ' + self.job_config.id)
self.update_min_seqs_from_store()
self.exit_loop_clean(self.logger)
very_first = False
#logging.info("CheckSync of " + self.job_config.id)
#self.db_handler.list_non_idle_nodes()
if not self.watcher.isAlive() and not self.interrupt:
logging.info("File watcher died, restarting...")
self.watcher.stop()
self.watcher = LocalWatcher(self.job_config.directory,
self.configs_path,
event_handler=self.event_handler)
self.start_watcher()
continue
self.global_progress['status_indexing'] = 1
logging.info('Reducing changes for ' + self.job_config.id)
self.logger.log_state(_('Merging changes between remote and local, please wait...'), 'sync')
# We are updating the status to IDLE here for the nodes which has status as NEW
# The reason is when we create a new sync on the existing folder, some of the files might
# already be synchronized and we ignore those files while we Dedup changes and those files
# remain untouched later.
# So the flow of node status change will occur as follows
# NEW (as soon as we create a new sync task)
# |
# IDLE (here, just before we reduce changes)
# |
# PENDING (those files/folders which remain after reducing changes and to be actually processed)
# |
# UP / DOWN / CONFLICT (corresponding the operation which occurs)
# |
# IDLE (The final state once upload/ download happens or once when the conflict is resolved)
self.db_handler.update_bulk_node_status_as_idle()
logging.debug('[CMERGER] Delete Copies ' + self.job_config.id)
self.current_store.delete_copies()
self.update_min_seqs_from_store()
logging.debug('[CMERGER] Dedup changes ' + self.job_config.id)
self.current_store.dedup_changes()
self.update_min_seqs_from_store()
if not self.storage_watcher or very_first:
logging.debug('[CMERGER] Detect unnecessary changes ' + self.ws_id)
self.logger.log_state(_('Detecting unecessary changes...'), 'sync')
self.current_store.detect_unnecessary_changes()
logging.debug('[CMERGER] Done detecting unnecessary changes')
self.logger.log_state(_('Done detecting unecessary changes...'), 'sync')
self.update_min_seqs_from_store()
logging.debug('Clearing op and pruning folders moves ' + self.job_config.id)
self.current_store.clear_operations_buffer()
self.current_store.prune_folders_moves()
self.update_min_seqs_from_store()
logging.debug('Store conflicts ' + self.job_config.id)
store_conflicts = self.current_store.clean_and_detect_conflicts(self.db_handler)
if store_conflicts:
if self.job_config.solve == 'both':
logging.info('Marking nodes SOLVED:KEEPBOTH')
for row in self.db_handler.list_conflict_nodes():
self.db_handler.update_node_status(row['node_path'], 'SOLVED:KEEPBOTH')
store_conflicts = self.current_store.clean_and_detect_conflicts(self.db_handler)
if store_conflicts:
logging.info('Conflicts detected, cannot continue!')
self.logger.log_state(_('Conflicts detected, cannot continue!'), 'error')
self.current_store.close()
self.sleep_offline()