From 9348a308ff54c046b242bd2fd8e572601ecc32ad Mon Sep 17 00:00:00 2001 From: franck cuny Date: Wed, 10 Feb 2010 11:03:30 +0100 Subject: small fix --- lib/githubexplorer/Repository.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/githubexplorer/Repository.pm b/lib/githubexplorer/Repository.pm index 664d727..90adcd0 100644 --- a/lib/githubexplorer/Repository.pm +++ b/lib/githubexplorer/Repository.pm @@ -3,6 +3,7 @@ use 5.010; use Moose::Role; use Net::GitHub::V2::Repositories; use YAML::Syck; +use Try::Tiny; sub fetch_repositories { my ( $self, $profile ) = @_; @@ -15,9 +16,9 @@ sub fetch_repositories { my $repo_list = $github_profile->list(); - while ( ref $repo_list ne 'ARRAYREF' ) { + if ( ref $repo_list ne 'ARRAY' ) { sleep(60); - $repo_list = $github_profile->list(); + return; } foreach my $repos (@$repo_list) { @@ -41,9 +42,9 @@ sub fetch_repositories { token => $self->api_token, ); my $langs = $api_repos->languages; - while ( ref $langs ne 'HASHREF' ) { + if ( ref $langs ne 'HASH' ) { sleep(60); - $langs = $api_repos->languages; + next; } foreach my $lang ( keys %$langs ) { -- cgit v1.2.3