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
339b06a4
Commit
339b06a4
authored
Mar 05, 2021
by
syasonik
Committed by
Adam Hegyi
Oct 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow shift persistence for rotations to scale
parent
f746aadb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
ee/app/models/incident_management/oncall_rotation.rb
ee/app/models/incident_management/oncall_rotation.rb
+2
-0
ee/app/workers/incident_management/oncall_rotations/persist_all_rotations_shifts_job.rb
...ment/oncall_rotations/persist_all_rotations_shifts_job.rb
+4
-2
No files found.
ee/app/models/incident_management/oncall_rotation.rb
View file @
339b06a4
...
...
@@ -2,6 +2,8 @@
module
IncidentManagement
class
OncallRotation
<
ApplicationRecord
include
EachBatch
ActivePeriod
=
Struct
.
new
(
:start_time
,
:end_time
)
do
def
present?
start_time
&&
end_time
...
...
ee/app/workers/incident_management/oncall_rotations/persist_all_rotations_shifts_job.rb
View file @
339b06a4
...
...
@@ -15,8 +15,10 @@ module IncidentManagement
queue_namespace
:cronjob
def
perform
IncidentManagement
::
OncallRotation
.
in_progress
.
pluck
(
:id
).
each
do
|
rotation_id
|
# rubocop: disable CodeReuse/ActiveRecord
IncidentManagement
::
OncallRotations
::
PersistShiftsJob
.
perform_async
(
rotation_id
)
IncidentManagement
::
OncallRotation
.
each_batch
do
|
rotations
|
rotations
.
in_progress
.
ids
.
each
do
|
id
|
# rubocop: disable CodeReuse/ActiveRecord
IncidentManagement
::
OncallRotations
::
PersistShiftsJob
.
perform_async
(
id
)
end
end
end
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