diff options
author | Perl Tidy <perltidy@bugzilla.org> | 2018-12-05 21:38:52 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-12-05 23:49:08 +0100 |
commit | 8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch) | |
tree | 9d270f173330ca19700e0ba9f2ee931300646de1 /scripts/cereal.pl | |
parent | a7bb5a65b71644d9efce5fed783ed545b9336548 (diff) | |
download | bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz |
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'scripts/cereal.pl')
-rwxr-xr-x | scripts/cereal.pl | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/scripts/cereal.pl b/scripts/cereal.pl index bc4d8abd4..4ca8df351 100755 --- a/scripts/cereal.pl +++ b/scripts/cereal.pl @@ -12,10 +12,15 @@ use warnings; use File::Basename; use File::Spec; + BEGIN { - require lib; - my $dir = File::Spec->rel2abs(File::Spec->catdir(dirname(__FILE__), '..')); - lib->import($dir, File::Spec->catdir($dir, 'lib'), File::Spec->catdir($dir, qw(local lib perl5))); + require lib; + my $dir = File::Spec->rel2abs(File::Spec->catdir(dirname(__FILE__), '..')); + lib->import( + $dir, + File::Spec->catdir($dir, 'lib'), + File::Spec->catdir($dir, qw(local lib perl5)) + ); } use Bugzilla::DaemonControl qw(catch_signal); @@ -28,25 +33,25 @@ $ENV{LOGGING_PORT} //= 5880; STDOUT->autoflush(1); -my $loop = IO::Async::Loop->new; +my $loop = IO::Async::Loop->new; my $on_stream = sub { - my ($stream) = @_; - my $protocol = IO::Async::Protocol::LineStream->new( - transport => $stream, - on_read_line => sub { - my ( $self, $line ) = @_; - say $line; - }, - ); - $loop->add($protocol); + my ($stream) = @_; + my $protocol = IO::Async::Protocol::LineStream->new( + transport => $stream, + on_read_line => sub { + my ($self, $line) = @_; + say $line; + }, + ); + $loop->add($protocol); }; my @signals = qw( TERM INT KILL ); $loop->listen( - host => '127.0.0.1', - service => $ENV{LOGGING_PORT}, - socktype => 'stream', - on_stream => $on_stream, + host => '127.0.0.1', + service => $ENV{LOGGING_PORT}, + socktype => 'stream', + on_stream => $on_stream, )->get; exit Future->wait_any(map { catch_signal($_, 0) } @signals)->get; |