Skip to content

Commit

Permalink
Simplify WebUIConnection method arguments with signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
okurz committed Feb 11, 2021
1 parent b791226 commit 4c2e8c8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/OpenQA/Worker/WebUIConnection.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# with this program; if not, see <http://www.gnu.org/licenses/>.

package OpenQA::Worker::WebUIConnection;
use Mojo::Base 'Mojo::EventEmitter';
use Mojo::Base 'Mojo::EventEmitter', -signatures;

use OpenQA::Log qw(log_error log_debug log_warning log_info);
use OpenQA::Utils qw(feature_scaling rand_range logistic_map_steps);
Expand Down Expand Up @@ -194,10 +194,9 @@ sub _setup_websocket_connection {
$command_handler->handle_command(@_);
});
$tx->on(
finish => sub {
finish => sub ($tx, $code, $reason = 'no reason') {
# uncoverable subroutine
# https://progress.opensuse.org/issues/55364
my ($tx, $code, $reason) = (shift, shift, shift // 'no reason');

# Subprocesses reset the event loop (which triggers this event),
# and since only the main worker process uses the WebSocket we
Expand All @@ -210,8 +209,7 @@ sub _setup_websocket_connection {
return log_debug("Websocket connection to $websocket_url finished from our side.")
unless $self->websocket_connection;

$self->websocket_connection(undef); # uncoverable statement
$self->_set_status( # uncoverable statement
$self->websocket_connection(undef)->_set_status( # uncoverable statement
failed => {
error_message =>
"Websocket connection to $websocket_url finished by remote side with code $code, $reason"
Expand Down

0 comments on commit 4c2e8c8

Please sign in to comment.