Skip to content

Commit

Permalink
fixed render_later to prevent delayed rendering warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 11, 2011
1 parent 3889e29 commit 56f8a16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -11,6 +11,7 @@ This file documents the revision history for Perl extension Mojolicious.
- Improved documentation.
- Fixed enabling of Perl 5.10 features in Mojo::Base and
Mojolicious::Lite. (garu, sri)
- Fixed render_later to prevent delayed rendering warning.

1.31 2011-05-08 00:00:00
- Reverted deprecation of Perl 5.8.x support, by popular demand.
Expand Down
7 changes: 0 additions & 7 deletions lib/Mojo/Server.pm
Expand Up @@ -23,14 +23,7 @@ has on_request => sub {
sub {
my $app = shift->app;
my $tx = shift;

# Handle transaction
$app->handler($tx);

# Delayed
$app->log->debug(
'Waiting for delayed response, forgot to render or resume?')
unless $tx->is_writing;
};
};
has on_transaction => sub {
Expand Down
5 changes: 5 additions & 0 deletions lib/Mojolicious.pm
Expand Up @@ -205,6 +205,11 @@ sub handler {
$tx->res->code(500);
$tx->resume;
}

# Delayed
$self->log->debug(
'Waiting for delayed response, forgot to render or resume?')
unless $stash->{'mojo.rendered'} || $tx->is_writing;
}

# "This snow is beautiful. I'm glad global warming never happened.
Expand Down

0 comments on commit 56f8a16

Please sign in to comment.