MT#19443 Increase prosody connect and wait timeout

Change-Id: I85c666e169771f0290c26fec377a9b5dcedc59d3
changes/88/5888/2
Andreas Granig 10 years ago committed by Víctor Seva
parent 7e47c361a4
commit 548d59499a

@ -6,14 +6,17 @@ use Net::Telnet;
sub activate_domain {
my ($c, $domain) = @_;
my $t = Net::Telnet->new(Timeout => 1);
my $t = Net::Telnet->new(Timeout => 5);
my $hosts = _load_servers($c);
my $ok = 1;
foreach my $host(@{ $hosts }) {
$t->open(Host => $host->{ip}, Port => $host->{port});
$t->waitfor('/http:\/\/prosody.im\/doc\/console/');
$t->print("host:activate('$domain')");
my ($res, $amatch) = $t->waitfor('/(Result: \w+)|(Message: .+)/');
my ($res, $amatch) = $t->waitfor(
Match => '/(Result: \w+)|(Message: .+)/',
Timeout => 20
);
if($amatch =~ /Result:\s*true/) {
# fine
} else {
@ -35,14 +38,17 @@ sub activate_domain {
sub deactivate_domain {
my ($c, $domain) = @_;
my $t = Net::Telnet->new(Timeout => 1);
my $t = Net::Telnet->new(Timeout => 5);
my $hosts = _load_servers($c);
my $ok = 1;
foreach my $host(@{ $hosts }) {
$t->open(Host => $host->{ip}, Port => $host->{port});
$t->waitfor('/http:\/\/prosody.im\/doc\/console/');
$t->print("host:deactivate('$domain')");
my ($res, $amatch) = $t->waitfor('/(Result: \w+)|(Message: .+)/');
my ($res, $amatch) = $t->waitfor(
Match => '/(Result: \w+)|(Message: .+)/',
Timeout => 20
);
if($amatch =~ /Result:\s*true/) {
# fine
} else {

Loading…
Cancel
Save