Skip to content

Commit

Permalink
no need to check the transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 20, 2015
1 parent c6c76a9 commit d53773a
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -229,17 +229,10 @@ sub _write {

# Finish or continue writing
weaken $self;
my $cb = sub { $self->_write($id) };
if ($tx->is_finished) {
if ($tx->has_subscribers('finish')) {
$cb = sub { $self->_finish($id) }
}
else {
$self->_finish($id);
return unless $c->{tx};
}
}
$stream->write('' => $cb);
my $next = '_write';
$tx->has_subscribers('finish') ? ($next = '_finish') : $self->_finish($id)
if $tx->is_finished;
$stream->write('' => sub { $self->$next($id) });
}

1;
Expand Down

0 comments on commit d53773a

Please sign in to comment.