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/Network.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/Network.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/githubexplorer/Network.pm b/lib/githubexplorer/Network.pm index eb6253f..dde08a4 100644 --- a/lib/githubexplorer/Network.pm +++ b/lib/githubexplorer/Network.pm @@ -7,6 +7,11 @@ use YAML::Syck; sub fetch_network { my ( $self, $repos ) = @_; + # check fork + my $check = $self->schema->resultset('Fork')->search({repos=> + $repos->id}); + return if $check->count > 0; + say ">> start on ".$repos->name; my $api_repos = Net::GitHub::V2::Repositories->new( owner => $repos->id_profile->login, @@ -16,6 +21,10 @@ sub fetch_network { ); my $edges = $api_repos->network(); + if (ref $edges ne 'ARRAY') { + sleep 60; + return; + } sleep(1); foreach my $edge (@$edges) { next if $edge->{owner} eq $repos->id_profile->login; |
