From dba24e4e00c549bac2ef25277cc4b474432b4191 Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 7 Oct 2015 21:20:57 +0200 Subject: [PATCH] added batch processing limit to imap import --- src/imap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/imap.c b/src/imap.c index bff1795a..22a4001d 100644 --- a/src/imap.c +++ b/src/imap.c @@ -125,6 +125,13 @@ int process_imap_folder(int sd, int *seq, char *folder, struct session_data *sda data->import->total_messages += messages; for(i=data->import->start_position; i<=messages; i++){ + + /* whether to quit after processing a batch of messages */ + + if(data->import->batch_processing_limit > 0 && data->import->processed_messages >= data->import->batch_processing_limit){ + break; + } + data->import->processed_messages++; if(data->quiet == 0){ printf("processed: %7d [%3d%%]\r", data->import->processed_messages, 100*i/messages); fflush(stdout); }