From 8e91645e143b24092de2a2c3c40858212a12fd42 Mon Sep 17 00:00:00 2001 From: Oliver Kurz Date: Fri, 21 Oct 2022 10:49:25 +0200 Subject: [PATCH] Use signatures in Shared::Controller::Running --- lib/OpenQA/Shared/Controller/Running.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/OpenQA/Shared/Controller/Running.pm b/lib/OpenQA/Shared/Controller/Running.pm index 7baa92b13d2..12e188e6c16 100644 --- a/lib/OpenQA/Shared/Controller/Running.pm +++ b/lib/OpenQA/Shared/Controller/Running.pm @@ -112,14 +112,14 @@ sub streamtext ($self, $file_name, $start_hook = undef, $close_hook = undef) { # Check for new lines from the logfile using recurring timer # Setup utility function to close the connection if something goes wrong my $timer_id; - my $close_connection = sub { + my $close_connection = sub ($self) { Mojo::IOLoop->remove($timer_id); $close_hook->(); $self->finish; close $log; }; $timer_id = Mojo::IOLoop->recurring( - TEXT_STREAMING_INTERVAL() => sub { + TEXT_STREAMING_INTERVAL() => sub (@) { if (!$ino) { # log file was not yet opened return unless open($log, '<', $logfile); @@ -147,7 +147,7 @@ sub streamtext ($self, $file_name, $start_hook = undef, $close_hook = undef) { # Stop monitoring the logfile when the connection closes $self->on( - finish => sub { + finish => sub (@) { Mojo::IOLoop->remove($timer_id); $close_hook->($worker, $job); }); @@ -158,8 +158,7 @@ sub livelog ($self) { $self->streamtext('autoinst-log-live.txt'); } -sub liveterminal { - my ($self) = @_; +sub liveterminal ($self) { return 0 unless $self->init(); $self->streamtext('serial-terminal-live.txt'); }