예제 #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()
예제 #4
0
 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()))