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
13036f0a
Commit
13036f0a
authored
Dec 07, 2021
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use id_in instead of for_id
parent
ea6e0b81
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
3 deletions
+1
-3
app/models/namespaces/sync_event.rb
app/models/namespaces/sync_event.rb
+0
-1
app/models/projects/sync_event.rb
app/models/projects/sync_event.rb
+0
-1
app/services/ci/process_sync_events_service.rb
app/services/ci/process_sync_events_service.rb
+1
-1
No files found.
app/models/namespaces/sync_event.rb
View file @
13036f0a
...
@@ -9,7 +9,6 @@ class Namespaces::SyncEvent < ApplicationRecord
...
@@ -9,7 +9,6 @@ class Namespaces::SyncEvent < ApplicationRecord
scope
:preload_synced_relation
,
->
{
preload
(
:namespace
)
}
scope
:preload_synced_relation
,
->
{
preload
(
:namespace
)
}
scope
:order_by_id_asc
,
->
{
order
(
id: :asc
)
}
scope
:order_by_id_asc
,
->
{
order
(
id: :asc
)
}
scope
:for_id
,
->
(
id
)
{
where
(
id:
id
)
}
def
self
.
enqueue_worker
def
self
.
enqueue_worker
::
Namespaces
::
ProcessSyncEventsWorker
.
perform_async
# rubocop:disable CodeReuse/Worker
::
Namespaces
::
ProcessSyncEventsWorker
.
perform_async
# rubocop:disable CodeReuse/Worker
...
...
app/models/projects/sync_event.rb
View file @
13036f0a
...
@@ -9,7 +9,6 @@ class Projects::SyncEvent < ApplicationRecord
...
@@ -9,7 +9,6 @@ class Projects::SyncEvent < ApplicationRecord
scope
:preload_synced_relation
,
->
{
preload
(
:project
)
}
scope
:preload_synced_relation
,
->
{
preload
(
:project
)
}
scope
:order_by_id_asc
,
->
{
order
(
id: :asc
)
}
scope
:order_by_id_asc
,
->
{
order
(
id: :asc
)
}
scope
:for_id
,
->
(
id
)
{
where
(
id:
id
)
}
def
self
.
enqueue_worker
def
self
.
enqueue_worker
::
Projects
::
ProcessSyncEventsWorker
.
perform_async
# rubocop:disable CodeReuse/Worker
::
Projects
::
ProcessSyncEventsWorker
.
perform_async
# rubocop:disable CodeReuse/Worker
...
...
app/services/ci/process_sync_events_service.rb
View file @
13036f0a
...
@@ -33,7 +33,7 @@ module Ci
...
@@ -33,7 +33,7 @@ module Ci
max
=
events
.
last
max
=
events
.
last
events
.
each
{
|
event
|
@sync_class
.
sync!
(
event
)
}
events
.
each
{
|
event
|
@sync_class
.
sync!
(
event
)
}
@sync_event_class
.
for_id
(
min
.
id
..
max
.
id
).
delete_all
@sync_event_class
.
id_in
(
min
.
id
..
max
.
id
).
delete_all
end
end
def
enqueue_worker_if_there_still_event
def
enqueue_worker_if_there_still_event
...
...
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