Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
bae69410
Unverified
Commit
bae69410
authored
1 year ago
by
Matt Jankowski
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix Performance/Count cop (#24793)
parent
9189e90f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.rubocop_todo.yml
+0
-6
0 additions, 6 deletions
.rubocop_todo.yml
app/lib/importer/accounts_index_importer.rb
+2
-2
2 additions, 2 deletions
app/lib/importer/accounts_index_importer.rb
app/lib/importer/tags_index_importer.rb
+2
-2
2 additions, 2 deletions
app/lib/importer/tags_index_importer.rb
with
4 additions
and
10 deletions
.rubocop_todo.yml
+
0
−
6
View file @
bae69410
...
...
@@ -308,12 +308,6 @@ Performance/CollectionLiteralInLoop:
-
'
config/deploy.rb'
-
'
lib/mastodon/media_cli.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/Count
:
Exclude
:
-
'
app/lib/importer/accounts_index_importer.rb'
-
'
app/lib/importer/tags_index_importer.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SafeMultiline.
Performance/DeletePrefix
:
...
...
This diff is collapsed.
Click to expand it.
app/lib/importer/accounts_index_importer.rb
+
2
−
2
View file @
bae69410
...
...
@@ -6,8 +6,8 @@ class Importer::AccountsIndexImporter < Importer::BaseImporter
in_work_unit
(
tmp
)
do
|
accounts
|
bulk
=
Chewy
::
Index
::
Import
::
BulkBuilder
.
new
(
index
,
to_index:
accounts
).
bulk_body
indexed
=
bulk
.
selec
t
{
|
entry
|
entry
[
:index
]
}
.
size
deleted
=
bulk
.
selec
t
{
|
entry
|
entry
[
:delete
]
}
.
size
indexed
=
bulk
.
coun
t
{
|
entry
|
entry
[
:index
]
}
deleted
=
bulk
.
coun
t
{
|
entry
|
entry
[
:delete
]
}
Chewy
::
Index
::
Import
::
BulkRequest
.
new
(
index
).
perform
(
bulk
)
...
...
This diff is collapsed.
Click to expand it.
app/lib/importer/tags_index_importer.rb
+
2
−
2
View file @
bae69410
...
...
@@ -6,8 +6,8 @@ class Importer::TagsIndexImporter < Importer::BaseImporter
in_work_unit
(
tmp
)
do
|
tags
|
bulk
=
Chewy
::
Index
::
Import
::
BulkBuilder
.
new
(
index
,
to_index:
tags
).
bulk_body
indexed
=
bulk
.
selec
t
{
|
entry
|
entry
[
:index
]
}
.
size
deleted
=
bulk
.
selec
t
{
|
entry
|
entry
[
:delete
]
}
.
size
indexed
=
bulk
.
coun
t
{
|
entry
|
entry
[
:index
]
}
deleted
=
bulk
.
coun
t
{
|
entry
|
entry
[
:delete
]
}
Chewy
::
Index
::
Import
::
BulkRequest
.
new
(
index
).
perform
(
bulk
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment