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
0
Merge Requests
0
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
Titouan Soulard
slapos.core
Commits
ebbeb9e1
Commit
ebbeb9e1
authored
Oct 05, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: no need to use a tag if context is not reindexed
parent
02aa9604
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Base_reindexAndSenseAlarm.py
...em/portal_skins/slapos_cloud/Base_reindexAndSenseAlarm.py
+3
-2
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Base_reindexAndSenseAlarm.py
View file @
ebbeb9e1
...
@@ -4,8 +4,9 @@ alarm_tool = portal.portal_alarms
...
@@ -4,8 +4,9 @@ alarm_tool = portal.portal_alarms
if
alarm_tool
.
isSubscribed
()
and
len
(
alarm_id_list
):
if
alarm_tool
.
isSubscribed
()
and
len
(
alarm_id_list
):
# No alarm tool is not subscribed, respect this choice and do not activate any alarm
# No alarm tool is not subscribed, respect this choice and do not activate any alarm
tag
=
"%s-%s"
%
(
script
.
id
,
context
.
getRelativeUrl
())
tag
=
None
if
must_reindex_context
:
if
must_reindex_context
:
tag
=
"%s-%s"
%
(
script
.
id
,
context
.
getRelativeUrl
())
context
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
context
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
for
alarm_id
in
alarm_id_list
:
for
alarm_id
in
alarm_id_list
:
...
@@ -15,7 +16,7 @@ if alarm_tool.isSubscribed() and len(alarm_id_list):
...
@@ -15,7 +16,7 @@ if alarm_tool.isSubscribed() and len(alarm_id_list):
if
alarm
.
isActive
():
if
alarm
.
isActive
():
# Wait for the previous alarm run to be finished
# Wait for the previous alarm run to be finished
context
.
activate
(
after_path
=
alarm
.
getPath
()).
Base_reindexAndSenseAlarm
([
alarm_id
],
must_reindex_context
=
False
)
context
.
activate
(
after_path
=
alarm
.
getPath
()
,
after_tag
=
tag
).
Base_reindexAndSenseAlarm
([
alarm_id
],
must_reindex_context
=
False
)
else
:
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
...
...
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