示例#1
0
 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()))
示例#2
0
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()
示例#3
0
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()))