Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
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
Paul Graydon
wendelin
Commits
253ceb97
Commit
253ceb97
authored
Jan 28, 2022
by
Klaus Wölfel
Committed by
Levin Zimmermann
Jul 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wendelin: prevent race condition when creating new data analyses
parent
1f27491e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/ERP5Site_createDataAnalysisList.py
...al_skins/erp5_wendelin/ERP5Site_createDataAnalysisList.py
+15
-3
No files found.
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/ERP5Site_createDataAnalysisList.py
View file @
253ceb97
...
@@ -4,7 +4,7 @@ from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
...
@@ -4,7 +4,7 @@ from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
portal_catalog
=
portal
.
portal_catalog
now
=
DateTime
(
)
today
=
DateTime
().
strftime
(
'%d%m%Y'
)
if
not
include_delivered
:
if
not
include_delivered
:
batch_simulation_state
=
"stopped"
batch_simulation_state
=
"stopped"
...
@@ -52,13 +52,24 @@ for movement in portal_catalog(query = query):
...
@@ -52,13 +52,24 @@ for movement in portal_catalog(query = query):
transformation_list
.
append
(
transformation
)
transformation_list
.
append
(
transformation
)
for
transformation
in
transformation_list
:
for
transformation
in
transformation_list
:
is_shared_data_analysis
=
False
is_shared_data_analysis
=
False
data_analysis_id
=
"%s-%s-%s"
%
(
today
,
delivery
.
getId
(),
transformation
.
getId
())
# Check if analysis already exists
# Check if analysis already exists
data_analysis
=
portal_catalog
.
getResultValue
(
data_analysis
=
portal_catalog
.
getResultValue
(
portal_type
=
"Data Analysis"
,
portal_type
=
"Data Analysis"
,
specialise_relative_url
=
transformation
.
getRelativeUrl
(),
specialise_relative_url
=
transformation
.
getRelativeUrl
(),
causality_relative_url
=
delivery
.
getRelativeUrl
())
causality_relative_url
=
delivery
.
getRelativeUrl
())
# search again with ID in case data_analysis is not indexed yet
if
data_analysis
is
None
:
try
:
data_analysis
=
portal
.
data_analysis_module
[
data_analysis_id
]
except
KeyError
:
pass
if
data_analysis
is
not
None
:
if
data_analysis
is
not
None
:
continue
continue
# for first level analysis check if same kind of data analysis with same project and same source already exists
# for first level analysis check if same kind of data analysis with same project and same source already exists
...
@@ -88,7 +99,8 @@ for movement in portal_catalog(query = query):
...
@@ -88,7 +99,8 @@ for movement in portal_catalog(query = query):
source_project
=
delivery
.
getSourceProject
(),
source_project
=
delivery
.
getSourceProject
(),
destination
=
delivery
.
getDestination
(),
destination
=
delivery
.
getDestination
(),
destination_section
=
delivery
.
getDestinationSection
(),
destination_section
=
delivery
.
getDestinationSection
(),
destination_project
=
delivery
.
getDestinationProject
())
destination_project
=
delivery
.
getDestinationProject
(),
id
=
data_analysis_id
)
data_analysis
.
checkConsistency
(
fixit
=
True
)
data_analysis
.
checkConsistency
(
fixit
=
True
)
# create input and output lines
# create input and output lines
...
...
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