Multi server fix?

Shalon Wood <[email protected]> Mon, 04 Apr 2005 17:17:39 -0500
Newsgroups gmane.network.ubh
Message-ID <[email protected]>

I've got 4 servers I have access to. Unfortunately, one of the servers
lacks one of the groups I want, so I can't use that group.

Looking at it, process_groups operates on @servers. Is there any
reason not to have it make a local copy of @servers and operate on
that?

Ie, add a line

my @group_servers = @{$servers};

change all references to @{$servers} to @group_servers, change all
references to $servers to \@group_servers, and make the
following change?

    foreach my $server (@group_servers) {
        $server->{nntp}->reset_stats;
        if (!defined $server->{nntp}->group($group->{name})) {
            $log->error(
                        "Can't access ".$group->{name}.
                        " on server ".$server->{name});
-            return
+            @group_servers = grep { ! /$server/} @group_servers;
        }
    }

(Note: all code untested, off the top of my head, for demonstration
purposes only. Do not use on broken skin. Keep out of direct
sunlight.)

The effect would be that if ubh can't select that group on the server,
it would skip the server _for that group only_.

It might be a good idea to add a check to see if there are any servers
left after the loop and a specific error message if not, IE:

unless (@servers) {
        $log->error(
                "Couldn't access ".$group->{name}.
                " on any server -- Bogus group name?.");
}

A quick glance over the code doesn't show any great reason not to, and
it's fairly self-contained.

Comments?

Shalon Wood

-- 
Check out Strange Love -- an ezine of science fiction, fantasy, and
paranormal erotica. Only $2 for more than 20,000 words of fiction!

                 http://strangelove.pele.cx


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ubh/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/