Created
November 11, 2013 18:05
-
-
Save dotandimet/7417509 to your computer and use it in GitHub Desktop.
Bug that drove me nuts, a reference to an array in the callback prevents process_feeds from emptying it...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# can you spot the bug below? | |
sub load_and_go { | |
my $self = shift; | |
$self->render_later(); | |
my $subs = $self->backend->feeds->find({xmlUrl => $self->param('src')})->all; | |
$self->process_feeds( | |
$subs, | |
sub { | |
$self->redirect_to( | |
$self->url_for('/view/feed')->query({src => $subs->[0]->{xmlUrl}})); | |
} | |
); | |
} | |
# no bug | |
sub load_and_go { | |
my $self = shift; | |
$self->render_later(); | |
my $subs = $self->backend->feeds->find({xmlUrl => $self->param('src')})->all; | |
$self->process_feeds( | |
$subs, | |
sub { | |
$self->redirect_to( | |
$self->url_for('/view/feed')->query({src => $self->param('src')})); | |
} | |
); | |
} |
Same bug here too, I think: https://github.com/dotandimet/hadashot/blob/master/lib/Hadashot/Settings.pm#L91
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dotandimet/hadashot@f6fd3d3#diff-55350b807721cf5f5252f3abc989d122