Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
telecom
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
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
Roque
telecom
Commits
024bb516
Commit
024bb516
authored
Aug 14, 2018
by
Roque Porchetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_telecom_ingestion: fix handle invalids for split ingestions
parent
3f6ca327
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
36 deletions
+32
-36
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.py
...ortal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.py
+32
-20
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_startIngestionList.py
...kins/erp5_wendelin_telecom/ERP5Site_startIngestionList.py
+0
-1
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
.../IngestionPolicy_getIngestionOperationAndParameterDict.py
+0
-15
No files found.
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/Alarm_handleInvalids.py
View file @
024bb516
...
@@ -37,9 +37,21 @@ now = DateTime()
...
@@ -37,9 +37,21 @@ now = DateTime()
now_minus_max
=
now
-
1.0
/
24
/
60
*
9999
now_minus_max
=
now
-
1.0
/
24
/
60
*
9999
now_minus_10
=
now
-
1.0
/
24
/
60
*
10
now_minus_10
=
now
-
1.0
/
24
/
60
*
10
catalog_kw
=
{
'creation_date'
:
{
'query'
:
(
now_minus_max
,
now_minus_10
),
'range'
:
'minmax'
},
'simulation_state'
:
'planned'
}
catalog_kw
=
{
'creation_date'
:
{
'query'
:
(
now_minus_max
,
now_minus_10
),
'range'
:
'minmax'
},
'simulation_state'
:
'planned'
,
'portal_type'
:
'Data Ingestion'
}
for
data_ingestion
in
portal_catalog
(
portal_type
=
"Data Ingestion"
,
**
catalog_kw
):
for
data_ingestion
in
portal_catalog
(
**
catalog_kw
):
related_split_ingestions
=
portal_catalog
(
portal_type
=
"Data Ingestion"
,
simulation_state
=
"planned"
,
reference
=
data_ingestion
.
getReference
())
invalidate
=
True
for
related_ingestion
in
related_split_ingestions
:
# only invalidate if all related ingestion are old
if
len
(
portal_catalog
(
id
=
related_ingestion
.
getId
(),
**
catalog_kw
))
==
0
:
context
.
logEntry
(
"Data Ingestion %s is old, but it has related ingestion that are not. So it won't be invalidated yet."
%
data_ingestion
.
getId
())
invalidate
=
False
break
if
invalidate
:
# invalidate related Data Stream
# invalidate related Data Stream
kw_dict
=
{
"portal_type"
:
"Data Stream"
,
kw_dict
=
{
"portal_type"
:
"Data Stream"
,
"reference"
:
data_ingestion
.
getReference
()}
"reference"
:
data_ingestion
.
getReference
()}
...
...
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/ERP5Site_startIngestionList.py
View file @
024bb516
...
@@ -42,7 +42,6 @@ for data_ingestion in portal_catalog(portal_type = "Data Ingestion",
...
@@ -42,7 +42,6 @@ for data_ingestion in portal_catalog(portal_type = "Data Ingestion",
full_data_stream
=
data_stream
full_data_stream
=
data_stream
else
:
else
:
full_data_stream
.
appendData
(
data_stream
.
getData
())
full_data_stream
.
appendData
(
data_stream
.
getData
())
#data_stream.update_data("",0)
portal
.
data_stream_module
.
deleteContent
(
data_stream
.
getId
())
portal
.
data_stream_module
.
deleteContent
(
data_stream
.
getId
())
index
+=
1
index
+=
1
full_data_stream
.
validate
()
full_data_stream
.
validate
()
...
...
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/IngestionPolicy_getIngestionOperationAndParameterDict.py
View file @
024bb516
...
@@ -125,24 +125,9 @@ try:
...
@@ -125,24 +125,9 @@ try:
data_ingestion
.
plan
()
data_ingestion
.
plan
()
context
.
logEntry
(
"Data Ingestion planned."
)
context
.
logEntry
(
"Data Ingestion planned."
)
#else:
# log("Planned Data Ingestion found for reference: " + str(data_ingestion))
# context.logEntry("Planned Data Ingestion found for reference: " + str(data_ingestion))
# # find ingestion line for current resource
# for line in data_ingestion.objectValues(portal_type="Data Ingestion Line"):
# if line.getResourceReference() == resource_reference:
# input_line = line
# elif line.getResourceValue().getPortalType() == "Data Operation":
# operation_line = line
data_operation
=
operation_line
.
getResourceValue
()
data_operation
=
operation_line
.
getResourceValue
()
data_stream
=
input_line
.
getAggregateDataStreamValue
()
data_stream
=
input_line
.
getAggregateDataStreamValue
()
#if eof == "EOF":
# data_ingestion.start()
# log("Data Ingestion started.")
# context.logEntry("Data Ingestion started.")
return
data_operation
,
{
'data_stream'
:
data_stream
}
return
data_operation
,
{
'data_stream'
:
data_stream
}
except
Exception
as
e
:
except
Exception
as
e
:
context
.
logEntry
(
"[ERROR] Error during ingestion policy operation: "
+
str
(
e
))
context
.
logEntry
(
"[ERROR] Error during ingestion policy operation: "
+
str
(
e
))
...
...
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