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
8e3d3297
Commit
8e3d3297
authored
Jan 28, 2021
by
Pavel Shutsin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update snapshot worker arguments
parent
0224e857
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
ee/app/services/analytics/devops_adoption/segments/create_service.rb
...ices/analytics/devops_adoption/segments/create_service.rb
+1
-1
ee/app/workers/analytics/devops_adoption/create_all_snapshots_worker.rb
.../analytics/devops_adoption/create_all_snapshots_worker.rb
+1
-1
ee/spec/services/analytics/devops_adoption/segments/create_service_spec.rb
...analytics/devops_adoption/segments/create_service_spec.rb
+1
-1
ee/spec/workers/analytics/devops_adoption/create_all_snapshots_worker_spec.rb
...ytics/devops_adoption/create_all_snapshots_worker_spec.rb
+2
-2
No files found.
ee/app/services/analytics/devops_adoption/segments/create_service.rb
View file @
8e3d3297
...
...
@@ -20,7 +20,7 @@ module Analytics
segment
.
assign_attributes
(
attributes
)
if
segment
.
save
Analytics
::
DevopsAdoption
::
CreateSnapshotWorker
.
perform_async
(
segment
.
id
,
nil
)
Analytics
::
DevopsAdoption
::
CreateSnapshotWorker
.
perform_async
(
segment
.
id
)
ServiceResponse
.
success
(
payload:
response_payload
)
else
...
...
ee/app/workers/analytics/devops_adoption/create_all_snapshots_worker.rb
View file @
8e3d3297
...
...
@@ -16,7 +16,7 @@ module Analytics
# rubocop: disable CodeReuse/ActiveRecord
def
perform
::
Analytics
::
DevopsAdoption
::
Segment
.
all
.
pluck
(
:id
).
each
.
with_index
do
|
segment_id
,
i
|
CreateSnapshotWorker
.
perform_in
(
i
*
WORKERS_GAP
,
segment_id
,
nil
)
CreateSnapshotWorker
.
perform_in
(
i
*
WORKERS_GAP
,
segment_id
)
end
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
ee/spec/services/analytics/devops_adoption/segments/create_service_spec.rb
View file @
8e3d3297
...
...
@@ -28,7 +28,7 @@ RSpec.describe Analytics::DevopsAdoption::Segments::CreateService do
subject
expect
(
Analytics
::
DevopsAdoption
::
CreateSnapshotWorker
).
to
have_received
(
:perform_async
).
with
(
Analytics
::
DevopsAdoption
::
Segment
.
last
.
id
,
nil
)
expect
(
Analytics
::
DevopsAdoption
::
CreateSnapshotWorker
).
to
have_received
(
:perform_async
).
with
(
Analytics
::
DevopsAdoption
::
Segment
.
last
.
id
)
end
context
'when user is not an admin'
do
...
...
ee/spec/workers/analytics/devops_adoption/create_all_snapshots_worker_spec.rb
View file @
8e3d3297
...
...
@@ -11,8 +11,8 @@ RSpec.describe Analytics::DevopsAdoption::CreateAllSnapshotsWorker do
it
'schedules workers for each individual segment'
do
freeze_time
do
expect
(
Analytics
::
DevopsAdoption
::
CreateSnapshotWorker
).
to
receive
(
:perform_in
).
with
(
0
,
segment1
.
id
,
nil
)
expect
(
Analytics
::
DevopsAdoption
::
CreateSnapshotWorker
).
to
receive
(
:perform_in
).
with
(
5
,
segment2
.
id
,
nil
)
expect
(
Analytics
::
DevopsAdoption
::
CreateSnapshotWorker
).
to
receive
(
:perform_in
).
with
(
0
,
segment1
.
id
)
expect
(
Analytics
::
DevopsAdoption
::
CreateSnapshotWorker
).
to
receive
(
:perform_in
).
with
(
5
,
segment2
.
id
)
worker
.
perform
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