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
1 changed files with 2 additions and 1 deletions

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);
};