Mojo::IOLoop->next_tick(sub {Mojo::IOLoop->on(finish--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/58314c80-14ee-4cbe-8e2f-c7a5bebc7c0a%40googlegroups.com.
has Chrome => sub {
my $Self = shift;
my $Chrome = Selenium::Chrome->new(
extra_capabilities => {
chromeOptions => {
args => [
'headless', 'no-sandbox', 'window-size=1400,900',
'disk-cache-size=0', 'disable-gpu', 'v8-cache-options=off'
]
}
},
error_handler => sub { $Self->Log("W", $_[1]); }
);
return $Chrome;
};
$Self->hook(before_server_start => sub {
my ($Server, $App) = @_;
$Self->{Shutdown} = 0;
$Server->ioloop->on(finish => sub {
$Self->Log("I", "Shutdown Chrome");
$Self->{Shutdown} = 1;
$Self->Chrome->shutdown_binary;
});
});You could try shutting it down in an END {} block. To do this you would need to store the instance to shut down by process ID so you know which one to shut down.-Dan
On Fri, Mar 27, 2020 at 8:31 AM 'Frank Brendel' via Mojolicious <mojol...@googlegroups.com> wrote:
Hi,--my application needs to load Selenium::Chrome for every single worker process.I made this viaMojo::IOLoop->next_tick(sub {$Self->{Chrome} = Selenium::Chrome->new(extra_capabilities => {chromeOptions => {args => ['headless', 'no-sandbox', 'window-size=1400,900','disk-cache-size=0', 'disable-gpu', 'v8-cache-options=off']}},);
But I have no idea where to shutdown the chrome binary.I've tried it via theMojo::IOLoop->on(finish
event but that stops the chromedriver to early so that outstanding Selenium requests fail.ThanksFrank
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojol...@googlegroups.com.