Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
erp5
Commits
a85ca023
Commit
a85ca023
authored
Oct 14, 2022
by
Kazuhiko Shiozaki
Committed by
Arnaud Fontaine
Mar 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: Base64 encode inventory cache, as Shared.DC.ZRDB.DA.SQL tries to decode bytes to str.
parent
7ea2c9e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SimulationTool.py
...emplateItem/portal_components/tool.erp5.SimulationTool.py
+4
-3
No files found.
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SimulationTool.py
View file @
a85ca023
...
@@ -62,6 +62,7 @@ from hashlib import md5
...
@@ -62,6 +62,7 @@ from hashlib import md5
from
warnings
import
warn
from
warnings
import
warn
from
six.moves.cPickle
import
loads
,
dumps
from
six.moves.cPickle
import
loads
,
dumps
from
copy
import
deepcopy
from
copy
import
deepcopy
import
base64
import
six
import
six
MYSQL_MIN_DATETIME_RESOLUTION
=
1
/
86400.
MYSQL_MIN_DATETIME_RESOLUTION
=
1
/
86400.
...
@@ -1438,7 +1439,7 @@ class SimulationTool(BaseTool):
...
@@ -1438,7 +1439,7 @@ class SimulationTool(BaseTool):
if
src__
:
if
src__
:
sql_source_list
.
append
(
Resource_zGetInventoryCacheResult
(
src__
=
1
,
**
inventory_cache_kw
))
sql_source_list
.
append
(
Resource_zGetInventoryCacheResult
(
src__
=
1
,
**
inventory_cache_kw
))
if
cached_sql_result
:
if
cached_sql_result
:
brain_result
=
loads
(
cached_sql_result
[
0
].
result
)
brain_result
=
loads
(
base64
.
b64decode
(
cached_sql_result
[
0
].
result
)
)
# Rebuild the brains
# Rebuild the brains
cached_result
=
Results
(
cached_result
=
Results
(
(
brain_result
[
'items'
],
brain_result
[
'data'
]),
(
brain_result
[
'items'
],
brain_result
[
'data'
]),
...
@@ -1487,10 +1488,10 @@ class SimulationTool(BaseTool):
...
@@ -1487,10 +1488,10 @@ class SimulationTool(BaseTool):
self
.
Resource_zInsertInventoryCacheResult
(
self
.
Resource_zInsertInventoryCacheResult
(
query
=
sql_text_hash
,
query
=
sql_text_hash
,
date
=
cached_date
,
date
=
cached_date
,
result
=
dumps
({
result
=
base64
.
b64encode
(
dumps
({
'items'
:
result
.
__items__
,
'items'
:
result
.
__items__
,
'data'
:
result
.
_data
,
'data'
:
result
.
_data
,
}),
})
)
,
)
)
else
:
else
:
# Cache miss and this getInventory() not specifying to_date,
# Cache miss and this getInventory() not specifying to_date,
...
...
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