Mercurial > dovecot > original-hg > dovecot-1.2
comparison src/lib-storage/index/maildir/maildir-sync.c @ 2322:aae574ed7f4c HEAD
Broke mailbox_sync() into iterator.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 12 Jul 2004 14:35:50 +0300 |
parents | 8a6666a9ac98 |
children | 9c830d1a4ebf |
comparison
equal
deleted
inserted
replaced
2321:d803ba0206f0 | 2322:aae574ed7f4c |
---|---|
911 ret = maildir_sync_context(ctx, TRUE); | 911 ret = maildir_sync_context(ctx, TRUE); |
912 maildir_sync_deinit(ctx); | 912 maildir_sync_deinit(ctx); |
913 return ret; | 913 return ret; |
914 } | 914 } |
915 | 915 |
916 int maildir_storage_sync(struct mailbox *box, enum mailbox_sync_flags flags) | 916 struct mailbox_sync_context * |
917 maildir_storage_sync_init(struct mailbox *box, enum mailbox_sync_flags flags) | |
917 { | 918 { |
918 struct index_mailbox *ibox = (struct index_mailbox *)box; | 919 struct index_mailbox *ibox = (struct index_mailbox *)box; |
919 struct maildir_sync_context *ctx; | 920 struct maildir_sync_context *ctx; |
920 int ret; | 921 int ret = 0; |
921 | 922 |
922 if ((flags & MAILBOX_SYNC_FLAG_FAST) == 0 || | 923 if ((flags & MAILBOX_SYNC_FLAG_FAST) == 0 || |
923 ibox->sync_last_check + MAILBOX_FULL_SYNC_INTERVAL <= ioloop_time) { | 924 ibox->sync_last_check + MAILBOX_FULL_SYNC_INTERVAL <= ioloop_time) { |
924 ibox->sync_last_check = ioloop_time; | 925 ibox->sync_last_check = ioloop_time; |
925 | 926 |
926 ctx = maildir_sync_context_new(ibox); | 927 ctx = maildir_sync_context_new(ibox); |
927 ret = maildir_sync_context(ctx, FALSE); | 928 ret = maildir_sync_context(ctx, FALSE); |
928 maildir_sync_deinit(ctx); | 929 maildir_sync_deinit(ctx); |
929 | 930 } |
930 if (ret < 0) | 931 |
931 return -1; | 932 return index_mailbox_sync_init(box, flags, ret < 0); |
932 } | 933 } |
933 | |
934 return index_storage_sync(box, flags); | |
935 } |