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
iv
gitlab-ce
Commits
e00e54b6
Commit
e00e54b6
authored
Mar 19, 2013
by
Sato Hiroyuki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix timeout error while showing the very large repo like git repo.
parent
46fa9218
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
app/models/network/graph.rb
app/models/network/graph.rb
+21
-4
No files found.
app/models/network/graph.rb
View file @
e00e54b6
...
...
@@ -66,13 +66,30 @@ module Network
# Skip count that the target commit is displayed in center.
def
count_to_display_commit_in_center
commit_index
=
find_commits
.
index
do
|
c
|
offset
=
-
1
skip
=
0
while
offset
==
-
1
tmp_commits
=
find_commits
(
skip
)
if
tmp_commits
.
size
>
0
index
=
tmp_commits
.
index
do
|
c
|
c
.
id
==
@commit
.
id
end
if
commit_index
&&
(
self
.
class
.
max_count
/
2
<
commit_index
)
then
if
index
# Find the target commit
offset
=
index
+
skip
else
skip
+=
self
.
class
.
max_count
end
else
# Cant't find the target commit in the repo.
offset
=
0
end
end
if
self
.
class
.
max_count
/
2
<
offset
then
# get max index that commit is displayed in the center.
commit_index
-
self
.
class
.
max_count
/
2
offset
-
self
.
class
.
max_count
/
2
else
0
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