diff options
| author | franck cuny <franck@lumberjaph.net> | 2010-02-12 12:00:27 +0100 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2010-02-12 12:00:27 +0100 |
| commit | 1f68a82c35b01fd5a8efbf3894d74c020acaf7ed (patch) | |
| tree | 1d76cfd9866ecb81da0d1ba086cd867e50359959 /lib/githubexplorer/Repository.pm | |
| parent | wip (diff) | |
| parent | wip (diff) | |
| download | github-explorer-1f68a82c35b01fd5a8efbf3894d74c020acaf7ed.tar.gz | |
Merge branch 'master' of lj:github-explorer
* 'master' of lj:github-explorer:
wip
prepare repos
small fix
Diffstat (limited to '')
| -rw-r--r-- | lib/githubexplorer/Repository.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/githubexplorer/Repository.pm b/lib/githubexplorer/Repository.pm index 035450a..617e091 100644 --- a/lib/githubexplorer/Repository.pm +++ b/lib/githubexplorer/Repository.pm @@ -2,6 +2,7 @@ package githubexplorer::Repository; use 5.010; use Moose::Role; use Net::GitHub::V2::Repositories; +use Try::Tiny; sub fetch_repositories { my ( $self, $profile ) = @_; @@ -14,9 +15,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) { @@ -40,9 +41,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 ) { |
