Most confusing is that morbo declares an inactivity timeout
sometimes if I both set MOJO_INACTIVITY_TIMEOUT=2 and set $c->inactivity_timeout(2) via the helper and then sleep 3. (see morboruns.txt)
Here is the tiny app I'm testing with:
#!/usr/bin/perl -w
use Mojolicious::Lite;
use 5.20.0;
use experimental 'signatures';
get '/' => sub {
my ($c) = @_;
if (defined $ENV{MY_INACTIVITY}) {
$c->app->log->debug( sprintf "setting \$c->inactivity_timeout(%d)",
$ENV{MY_INACTIVITY} );
$c->inactivity_timeout($ENV{MY_INACTIVITY});
}
my $sleep = $ENV{SLEEP} // 20;
$c->app->log->debug( sprintf "sleeping %d", $sleep );
sleep $sleep;
$c->render(text => "hello world")
};
app->start;
I get similar inconsistencies when running both:
SLEEP=3 MY_INACTIVITY=2 MOJO_INACTIVITY_TIMEOUT=2 morbo
lite.pland
SLEEP=3 MY_INACTIVITY=2 MOJO_INACTIVITY_TIMEOUT=2 ./
lite.pl daemon -m production -l http://*:8081
Is there anything I'm doing wrong? I was expecting it to always declare an inactivity timeout given these settings.
Sincerely,
Peter