]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/IMAPD.pm
t/imapd.t: skip dependent test on failure
[public-inbox.git] / lib / PublicInbox / IMAPD.pm
index fe50de0f7cdee63295eba919172dc8f07a514e83..3c211ee1bf111568b70040c2b97559f9a88c7580 100644 (file)
@@ -6,6 +6,7 @@
 package PublicInbox::IMAPD;
 use strict;
 use PublicInbox::Config;
+use PublicInbox::ConfigIter;
 use PublicInbox::InboxIdle;
 use PublicInbox::IMAP;
 use PublicInbox::DummyInbox;
@@ -74,11 +75,6 @@ sub imapd_refresh_finalize {
                        my $u = $_; # capitalize "INBOX" for user-familiarity
                        $u =~ s/\Ainbox(\.|\z)/INBOX$1/i;
                        qq[* LIST (\\Has${no}Children) "." $u\r\n]
-               } sort {
-                       # shortest names first, alphabetically if lengths match
-                       length($a) == length($b) ?
-                               ($a cmp $b) :
-                               (length($a) <=> length($b))
                } keys %$mailboxes
        ];
        $imapd->{pi_config} = $pi_config;
@@ -103,8 +99,9 @@ sub refresh_groups {
        my $pi_config = PublicInbox::Config->new;
        if ($sig) { # SIGHUP is handled through the event loop
                $self->{imapd_next} = { dummies => {}, mailboxes => {} };
-               $pi_config->iterate_start(\&imapd_refresh_step, $self);
-               PublicInbox::DS::requeue($pi_config); # call event_step
+               my $iter = PublicInbox::ConfigIter->new($pi_config,
+                                               \&imapd_refresh_step, $self);
+               $iter->event_step;
        } else { # initial start is synchronous
                $self->{dummies} = {};
                $pi_config->each_inbox(\&imapd_refresh_ibx, $self);