diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index 399ae696..da6e72f3 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -24,7 +24,6 @@ use Text::ParseWords; use JSON; use PBot::FactoidCommands; -use PBot::FactoidModuleLauncher; use PBot::DualIndexHashObject; use PBot::Utils::Indefinite; @@ -37,7 +36,6 @@ sub initialize { $self->{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', 'max_name_length', 100); @@ -709,7 +707,7 @@ sub execute_code_factoid_using_vm { $stuff->{arguments} = $json; $stuff->{args_utf8} = 1; - $self->{pbot}->{factoids}->{factoidmodulelauncher}->execute_module($stuff); + $self->{pbot}->{process_manager}->execute_module($stuff); return ""; } @@ -1035,7 +1033,7 @@ sub handle_action { $stuff->{root_keyword} = $keyword unless defined $stuff->{root_keyword}; $stuff->{root_channel} = $channel; - my $result = $self->{factoidmodulelauncher}->execute_module($stuff); + my $result = $self->{pbot}->{process_manager}->execute_module($stuff); if (length $result) { return $ref_from . $result; } else { diff --git a/PBot/PBot.pm b/PBot/PBot.pm index b49ddfc7..a98c75b3 100644 --- a/PBot/PBot.pm +++ b/PBot/PBot.pm @@ -47,6 +47,7 @@ use PBot::Plugins; use PBot::WebPaste; use PBot::Utils::ParseDate; use PBot::Functions; +use PBot::ProcessManager; sub new { my ($proto, %conf) = @_; @@ -204,6 +205,7 @@ sub initialize { } $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->{select_handler} = PBot::SelectHandler->new(pbot => $self, %conf); $self->{users} = PBot::Users->new(pbot => $self, filename => "$data_dir/users", %conf); diff --git a/Plugins/Wttr.pm b/Plugins/Wttr.pm index 1268923a..cf93a38f 100644 --- a/Plugins/Wttr.pm +++ b/Plugins/Wttr.pm @@ -112,7 +112,7 @@ sub get_wttr { 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 $json;