Method: Gitlab::GithubImport::Client#initialize

Defined in:
lib/gitlab/github_import/client.rb

#initialize(token, host: nil, per_page: DEFAULT_PER_PAGE, parallel: true) ⇒ Client

token - The GitHub API token to use.

host - The GitHub hostname. If nil, github.com will be used.

per_page - The number of objects that should be displayed per page.

parallel - When set to true hitting the rate limit will result in a

dedicated error being raised. When set to `false` we will
instead just `sleep()` until the rate limit is reset. Setting
this value to `true` for parallel importing is crucial as
otherwise hitting the rate limit will result in a thread
being blocked in a `sleep()` call for up to an hour.


50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/gitlab/github_import/client.rb', line 50

def initialize(token, host: nil, per_page: DEFAULT_PER_PAGE, parallel: true)
  @host = host
  @octokit = ::Octokit::Client.new(
    access_token: token,
    per_page: per_page,
    api_endpoint: api_endpoint,
    web_endpoint: web_endpoint
  )

  @octokit.connection_options[:ssl] = { verify: verify_ssl }

  @parallel = parallel
end