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
49d3e7c1
Commit
49d3e7c1
authored
Apr 30, 2020
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove update_project_statistics_after_commit FF
parent
972c347a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
30 deletions
+4
-30
app/models/concerns/update_project_statistics.rb
app/models/concerns/update_project_statistics.rb
+2
-12
spec/models/ci/job_artifact_spec.rb
spec/models/ci/job_artifact_spec.rb
+2
-18
No files found.
app/models/concerns/update_project_statistics.rb
View file @
49d3e7c1
...
...
@@ -68,21 +68,11 @@ module UpdateProjectStatistics
def
schedule_update_project_statistic
(
delta
)
return
if
delta
.
zero?
return
if
project
.
nil?
if
Feature
.
enabled?
(
:update_project_statistics_after_commit
,
default_enabled:
true
)
# Update ProjectStatistics after the transaction
run_after_commit
do
ProjectStatistics
.
increment_statistic
(
project_id
,
self
.
class
.
project_statistics_name
,
delta
)
end
else
# Use legacy-way to update within transaction
run_after_commit
do
ProjectStatistics
.
increment_statistic
(
project_id
,
self
.
class
.
project_statistics_name
,
delta
)
end
run_after_commit
do
next
if
project
.
nil?
Namespaces
::
ScheduleAggregationWorker
.
perform_async
(
project
.
namespace_id
)
...
...
spec/models/ci/job_artifact_spec.rb
View file @
49d3e7c1
...
...
@@ -19,24 +19,8 @@ describe Ci::JobArtifact do
it_behaves_like
'having unique enum values'
context
'with update_project_statistics_after_commit enabled'
do
before
do
stub_feature_flags
(
update_project_statistics_after_commit:
true
)
end
it_behaves_like
'UpdateProjectStatistics'
do
subject
{
build
(
:ci_job_artifact
,
:archive
,
size:
107464
)
}
end
end
context
'with update_project_statistics_after_commit disabled'
do
before
do
stub_feature_flags
(
update_project_statistics_after_commit:
false
)
end
it_behaves_like
'UpdateProjectStatistics'
do
subject
{
build
(
:ci_job_artifact
,
:archive
,
size:
107464
)
}
end
it_behaves_like
'UpdateProjectStatistics'
do
subject
{
build
(
:ci_job_artifact
,
:archive
,
size:
107464
)
}
end
describe
'.with_reports'
do
...
...
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