def run(self, taskQueue: Queue) -> None: """Sequentially process the accounts.""" # # Loop over the available account names. # for accountName in Channel(taskQueue): # The syncer let explode errors it can't recover from. try: self.processing(accountName) # Get the account instance from the rascal. account = loadAccount(accountName) self._syncAccount(account) # Wait until folders are done. self.setExitCode(0) #TODO: Here, we only keep max exit code. Would worth using the # rascal at the end of the process for each account. except Exception as e: runtime.ui.error("could not sync account %s" % accountName) runtime.ui.exception(e) #TODO: honor rascal! self.setExitCode(10) # See manual. self.checkExitCode() # Sanity check. self.referent.accountEngineDone(self.getExitCode())
def run(self, taskQueue: Queue) -> None: """Sequentially process the folders.""" # # Loop over the available folder names. # for folder in Channel(taskQueue): self.processing(folder) # The engine will let explode errors it can't recover from. try: exitCode = self._syncFolder(folder) self.setExitCode(exitCode) except Exception as e: runtime.ui.error("could not sync folder %s" % folder) runtime.ui.exception(e) #TODO: honor hook! self.setExitCode(10) # See manual. self.checkExitCode() self.referent.stop(self.getExitCode())
def run(self, taskQueue: Queue) -> None: """Sequentially process the accounts.""" # # Loop over the available account names. # for accountName in Channel(taskQueue): self.processing(accountName) # The syncer will let expode errors it can't recover from. try: # Get the account instance from the rascal. account = loadAccount(accountName) self._syncAccount(account) except Exception as e: runtime.ui.error("could not sync account %s"% accountName) runtime.ui.exception(e) #TODO: honor hook! self.setExitCode(10) # See manual. self.checkExitCode() self.referent.stop(self.getExitCode())