def main_loop(self, directory, loop_time): while True: start_time = time.time() import_attachment() # imap importer import_documents(directory) # local importer # Sleep until the start of the next loop step time.sleep(max(0, start_time + loop_time - time.time()))
def import_from_email(): """ Import attachments from specified email account. """ # if no email import defined, just skip the whole # thing. if not settings.PAPERMERGE_IMPORT_MAIL_USER: return logger.debug("Celery beat: import_from_email") import_attachment()
def import_from_email(): """ Import attachments from specified email account. """ logger.debug("Celery beat: import_from_email") import_attachment()
def main_loop(self, loop_time): while True: start_time = time.time() import_attachment() # Sleep until the start of the next loop step time.sleep(max(0, start_time + loop_time - time.time()))