3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

FactoidModuleLauncher: timeout now configurable via registry

This commit is contained in:
Pragmatic Software 2019-07-05 23:10:57 -07:00
parent a82f580f58
commit 64ad929de6

View File

@ -111,8 +111,9 @@ sub execute_module {
my ($exitval, $stdout, $stderr) = eval {
my @cmdline = ("./$module", $self->{pbot}->{interpreter}->split_line($stuff->{arguments}));
my $timeout = $self->{pbot}->{registry}->get_value('general', 'module_timeout') // 30;
my ($stdin, $stdout, $stderr);
run \@cmdline, \$stdin, \$stdout, \$stderr, timeout(10);
run \@cmdline, \$stdin, \$stdout, \$stderr, timeout($timeout);
my $exitval = $? >> 8;
return ($exitval, $stdout, $stderr);
};