Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
bf0ad382
Commit
bf0ad382
authored
Oct 11, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: speed up Base_reindexAndSenseAlarm execution
parent
7c4188b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Base_reindexAndSenseAlarm.py
...em/portal_skins/slapos_cloud/Base_reindexAndSenseAlarm.py
+5
-4
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Base_reindexAndSenseAlarm.py
View file @
bf0ad382
...
@@ -14,10 +14,11 @@ if alarm_tool.isSubscribed() and len(alarm_id_list):
...
@@ -14,10 +14,11 @@ if alarm_tool.isSubscribed() and len(alarm_id_list):
if
alarm
.
isEnabled
():
if
alarm
.
isEnabled
():
# do nothing if the alarm is not enabled
# do nothing if the alarm is not enabled
if
alarm
.
isActive
():
if
alarm
.
isActive
()
or
(
tag
is
not
None
)
:
# Wait for the previous alarm run to be finished
# Wait for the previous alarm run to be finished
context
.
activate
(
after_path
=
alarm
.
getPath
(),
after_tag
=
tag
).
Base_reindexAndSenseAlarm
([
alarm_id
],
must_reindex_context
=
False
)
else
:
# wait for the context to be reindexed before activating the alarm
# wait for the context to be reindexed before activating the alarm
# ROMAIN: SQLQueue is used, because I'm not sure if SQLDict drop activities with different after_tag
# ROMAIN: SQLQueue is used, because I'm not sure if SQLDict drop activities with different after_tag
alarm
.
activate
(
queue
=
'SQLQueue'
,
after_tag
=
tag
).
activeSense
()
# ROMAIN: getId is used, because most alarm script ends with an getId activity
alarm
.
activate
(
queue
=
'SQLQueue'
,
after_path_and_method_id
=
(
alarm
.
getPath
(),
'getId'
),
after_tag
=
tag
).
activeSense
()
else
:
alarm
.
activeSense
()
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