Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
7da13fee
Commit
7da13fee
authored
Feb 20, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a simple cache for Gitlab::GithubImport::Client#user
parent
2d1e0a08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
lib/gitlab/github_import/client.rb
lib/gitlab/github_import/client.rb
+8
-0
No files found.
lib/gitlab/github_import/client.rb
View file @
7da13fee
...
@@ -10,6 +10,7 @@ module Gitlab
...
@@ -10,6 +10,7 @@ module Gitlab
@access_token
=
access_token
@access_token
=
access_token
@host
=
host
.
to_s
.
sub
(
%r{/+
\z
}
,
''
)
@host
=
host
.
to_s
.
sub
(
%r{/+
\z
}
,
''
)
@api_version
=
api_version
@api_version
=
api_version
@users
=
{}
if
access_token
if
access_token
::
Octokit
.
auto_paginate
=
false
::
Octokit
.
auto_paginate
=
false
...
@@ -64,6 +65,13 @@ module Gitlab
...
@@ -64,6 +65,13 @@ module Gitlab
api
.
respond_to?
(
method
)
||
super
api
.
respond_to?
(
method
)
||
super
end
end
def
user
(
login
)
return
nil
unless
login
.
present?
return
@users
[
login
]
if
@users
.
key?
(
login
)
@users
[
login
]
=
api
.
user
(
login
)
end
private
private
def
api_endpoint
def
api_endpoint
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment