Skip to content

Commit

Permalink
Merge pull request #5755 from okurz/enhance/signatures12
Browse files Browse the repository at this point in the history
Use signatures in Shared::Controller::Running
  • Loading branch information
okurz authored Jul 23, 2024
2 parents bf55007 + 8e91645 commit 468dc67
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/OpenQA/Shared/Controller/Running.pm
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,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);
Expand Down Expand Up @@ -146,7 +146,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);
});
Expand All @@ -157,8 +157,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');
}
Expand Down

0 comments on commit 468dc67

Please sign in to comment.