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
12b031ce
Commit
12b031ce
authored
Jul 05, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pagination
parent
022a0c2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
lib/bitbucket_server/connection.rb
lib/bitbucket_server/connection.rb
+1
-1
lib/bitbucket_server/paginator.rb
lib/bitbucket_server/paginator.rb
+4
-4
No files found.
lib/bitbucket_server/connection.rb
View file @
12b031ce
...
...
@@ -16,7 +16,7 @@ module BitbucketServer
def
get
(
path
,
extra_query
=
{})
response
=
Gitlab
::
HTTP
.
get
(
build_url
(
path
),
basic_auth:
auth
,
params
:
extra_query
)
query
:
extra_query
)
check_errors!
(
response
)
response
.
parsed_response
...
...
lib/bitbucket_server/paginator.rb
View file @
12b031ce
module
BitbucketServer
class
Paginator
PAGE_LENGTH
=
25
# The minimum length is 10 and the maximum is 100.
PAGE_LENGTH
=
25
def
initialize
(
connection
,
url
,
type
)
@connection
=
connection
...
...
@@ -24,12 +24,12 @@ module BitbucketServer
page
.
nil?
||
page
.
next?
end
def
next_
url
page
.
nil?
?
url
:
page
.
next
def
next_
offset
page
.
nil?
?
0
:
page
.
next
end
def
fetch_next_page
parsed_response
=
connection
.
get
(
next_url
,
pagelen:
PAGE_LENGTH
,
sort: :created_on
)
parsed_response
=
connection
.
get
(
@url
,
start:
next_offset
,
limit:
PAGE_LENGTH
)
Page
.
new
(
parsed_response
,
type
)
end
end
...
...
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