Skip to content
Snippets Groups Projects
Commit 7da13fee authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Add a simple cache for Gitlab::GithubImport::Client#user

parent 2d1e0a08
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -10,6 +10,7 @@ module Gitlab
@access_token = access_token
@host = host.to_s.sub(%r{/+\z}, '')
@api_version = api_version
@users = {}
 
if access_token
::Octokit.auto_paginate = false
Loading
Loading
@@ -64,6 +65,13 @@ module Gitlab
api.respond_to?(method) || super
end
 
def user(login)
return nil unless login.present?
return @users[login] if @users.key?(login)
@users[login] = api.user(login)
end
private
 
def api_endpoint
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment