mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-16 21:40:46 +01:00
Plugins/Wttr: Increase timeout to 30 seconds
This commit is contained in:
parent
515c5c2c52
commit
f37dcaf7f9
@ -24,7 +24,6 @@ use Text::ParseWords;
|
|||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
use PBot::FactoidCommands;
|
use PBot::FactoidCommands;
|
||||||
use PBot::FactoidModuleLauncher;
|
|
||||||
use PBot::DualIndexHashObject;
|
use PBot::DualIndexHashObject;
|
||||||
|
|
||||||
use PBot::Utils::Indefinite;
|
use PBot::Utils::Indefinite;
|
||||||
@ -37,7 +36,6 @@ sub initialize {
|
|||||||
|
|
||||||
$self->{pbot} = $self->{pbot};
|
$self->{pbot} = $self->{pbot};
|
||||||
$self->{commands} = PBot::FactoidCommands->new(pbot => $self->{pbot});
|
$self->{commands} = PBot::FactoidCommands->new(pbot => $self->{pbot});
|
||||||
$self->{factoidmodulelauncher} = PBot::FactoidModuleLauncher->new(pbot => $self->{pbot});
|
|
||||||
|
|
||||||
$self->{pbot}->{registry}->add_default('text', 'factoids', 'default_rate_limit', 15);
|
$self->{pbot}->{registry}->add_default('text', 'factoids', 'default_rate_limit', 15);
|
||||||
$self->{pbot}->{registry}->add_default('text', 'factoids', 'max_name_length', 100);
|
$self->{pbot}->{registry}->add_default('text', 'factoids', 'max_name_length', 100);
|
||||||
@ -709,7 +707,7 @@ sub execute_code_factoid_using_vm {
|
|||||||
$stuff->{arguments} = $json;
|
$stuff->{arguments} = $json;
|
||||||
$stuff->{args_utf8} = 1;
|
$stuff->{args_utf8} = 1;
|
||||||
|
|
||||||
$self->{pbot}->{factoids}->{factoidmodulelauncher}->execute_module($stuff);
|
$self->{pbot}->{process_manager}->execute_module($stuff);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1035,7 +1033,7 @@ sub handle_action {
|
|||||||
$stuff->{root_keyword} = $keyword unless defined $stuff->{root_keyword};
|
$stuff->{root_keyword} = $keyword unless defined $stuff->{root_keyword};
|
||||||
$stuff->{root_channel} = $channel;
|
$stuff->{root_channel} = $channel;
|
||||||
|
|
||||||
my $result = $self->{factoidmodulelauncher}->execute_module($stuff);
|
my $result = $self->{pbot}->{process_manager}->execute_module($stuff);
|
||||||
if (length $result) {
|
if (length $result) {
|
||||||
return $ref_from . $result;
|
return $ref_from . $result;
|
||||||
} else {
|
} else {
|
||||||
|
@ -47,6 +47,7 @@ use PBot::Plugins;
|
|||||||
use PBot::WebPaste;
|
use PBot::WebPaste;
|
||||||
use PBot::Utils::ParseDate;
|
use PBot::Utils::ParseDate;
|
||||||
use PBot::Functions;
|
use PBot::Functions;
|
||||||
|
use PBot::ProcessManager;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($proto, %conf) = @_;
|
my ($proto, %conf) = @_;
|
||||||
@ -204,6 +205,7 @@ sub initialize {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$self->{event_dispatcher} = PBot::EventDispatcher->new(pbot => $self, %conf);
|
$self->{event_dispatcher} = PBot::EventDispatcher->new(pbot => $self, %conf);
|
||||||
|
$self->{process_manager} = PBot::ProcessManager->new(pbot => $self, %conf);
|
||||||
$self->{irchandlers} = PBot::IRCHandlers->new(pbot => $self, %conf);
|
$self->{irchandlers} = PBot::IRCHandlers->new(pbot => $self, %conf);
|
||||||
$self->{select_handler} = PBot::SelectHandler->new(pbot => $self, %conf);
|
$self->{select_handler} = PBot::SelectHandler->new(pbot => $self, %conf);
|
||||||
$self->{users} = PBot::Users->new(pbot => $self, filename => "$data_dir/users", %conf);
|
$self->{users} = PBot::Users->new(pbot => $self, filename => "$data_dir/users", %conf);
|
||||||
|
@ -112,7 +112,7 @@ sub get_wttr {
|
|||||||
|
|
||||||
my $location_uri = uri_escape_utf8 $location;
|
my $location_uri = uri_escape_utf8 $location;
|
||||||
|
|
||||||
my $ua = PBot::Utils::LWPUserAgentCached->new(\%cache_opt, timeout => 10);
|
my $ua = PBot::Utils::LWPUserAgentCached->new(\%cache_opt, timeout => 30);
|
||||||
my $response = $ua->get("http://wttr.in/$location_uri?format=j1&m");
|
my $response = $ua->get("http://wttr.in/$location_uri?format=j1&m");
|
||||||
|
|
||||||
my $json;
|
my $json;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user