Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7594:8ae5268762b5 HEAD
dbox sync rebuilding: Don't leave all maildir file fds open until the end of
sync. It can cause too many open files.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 02 Jun 2008 20:18:11 +0300 |
parents | 2d367594b41c |
children | cb55e435b79e |
files | src/lib-storage/index/dbox/dbox-sync-rebuild.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/dbox/dbox-sync-rebuild.c Mon Jun 02 20:01:42 2008 +0300 +++ b/src/lib-storage/index/dbox/dbox-sync-rebuild.c Mon Jun 02 20:18:11 2008 +0300 @@ -254,8 +254,12 @@ } file = dbox_file_init_new_maildir(ctx->mbox, fname); - if ((ret = dbox_sync_index_file_next(ctx, file, &offset)) > 0) + if ((ret = dbox_sync_index_file_next(ctx, file, &offset)) > 0) { dbox_index_append_file(ctx->append_ctx, file); + /* appending referenced the file, so make sure it gets closed + so we don't have too many open files. */ + dbox_file_close(file); + } dbox_file_unref(&file); return ret < 0 ? -1 : 0; }