@@ -15,15 +15,15 @@ defmodule CodeCorps.GitHub.API.Repository do
1515 @ spec issues ( GithubRepo . t ) :: { :ok , list ( map ) } | { :error , GitHub . api_error_struct }
1616 def issues ( % GithubRepo { github_app_installation: % GithubAppInstallation { } = installation } = github_repo ) do
1717 with { :ok , access_token } <- installation |> API.Installation . get_access_token ( ) ,
18- issues <- github_repo |> fetch_issues ( access_token ) do
18+ issues <- github_repo |> fetch_issues ( access_token ) do
1919 { :ok , issues }
2020 else
2121 { :error , error } -> { :error , error }
2222 end
2323 end
2424
25- defp fetch_issues ( % GithubRepo { github_account_login: owner , name: repo } , access_token ) do
26- path = "repos/#{ owner } /#{ repo } /issues"
25+ defp fetch_issues ( % GithubRepo { github_app_installation: % GithubAppInstallation { github_account_login: owner } , name: repo } , access_token ) do
26+ path = "repos/#{ owner } /#{ repo } /issues?state=all&per_page=100 "
2727 opts = [ access_token: access_token ]
2828
2929 # stream/lazy
@@ -33,10 +33,10 @@ defmodule CodeCorps.GitHub.API.Repository do
3333 IO . puts ( "Retrieving #{ results |> Enum . count } took #{ Timex . diff ( after_operation , before_operation ) } microseconds" )
3434
3535 # eager
36- before_operation = Timex . now
37- results = path |> fetch_eager ( opts )
38- after_operation = Timex . now
39- IO . puts ( "Retrieving #{ results |> Enum . count } took #{ Timex . diff ( after_operation , before_operation ) } microseconds" )
36+ # before_operation = Timex.now
37+ # results = path |> fetch_eager(opts)
38+ # after_operation = Timex.now
39+ # IO.puts("Retrieving #{results |> Enum.count} took #{Timex.diff(after_operation, before_operation)} microseconds")
4040
4141 results
4242 end
0 commit comments