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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
582ec28b
Commit
582ec28b
authored
Jan 09, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't update project statistics on a read-only instance
parent
1fcfac98
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
app/controllers/projects/git_http_controller.rb
app/controllers/projects/git_http_controller.rb
+1
-0
spec/controllers/projects/git_http_controller_spec.rb
spec/controllers/projects/git_http_controller_spec.rb
+10
-0
No files found.
app/controllers/projects/git_http_controller.rb
View file @
582ec28b
...
...
@@ -75,6 +75,7 @@ class Projects::GitHttpController < Projects::GitHttpClientController
end
def
enqueue_fetch_statistics_update
return
if
Gitlab
::
Database
.
read_only?
return
if
repo_type
.
wiki?
return
unless
project
&
.
daily_statistics_enabled?
...
...
spec/controllers/projects/git_http_controller_spec.rb
View file @
582ec28b
...
...
@@ -90,6 +90,16 @@ describe Projects::GitHttpController do
post
:git_upload_pack
,
params:
params
end
context
'on a read-only instance'
do
before
do
allow
(
Gitlab
::
Database
).
to
receive
(
:read_only?
).
and_return
(
true
)
end
it
'does not update project statistics'
do
expect
(
ProjectDailyStatisticsWorker
).
not_to
receive
(
:perform_async
)
end
end
it
'updates project statistics'
do
expect
(
ProjectDailyStatisticsWorker
).
to
receive
(
:perform_async
)
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