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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
2d42a55c
Commit
2d42a55c
authored
Aug 12, 2024
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: add an alarm to cleanup deleted_catalog table.
parent
8e14228a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
137 additions
and
0 deletions
+137
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Core.py
...tTemplateItem/portal_components/test.erp5.testERP5Core.py
+12
-0
product/ERP5/bootstrap/erp5_core/PathTemplateItem/portal_alarms/alarm_garbage_collect_deleted_catalog.xml
...m/portal_alarms/alarm_garbage_collect_deleted_catalog.xml
+95
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_zGarbageCollectDeletedCatalog.sql
...l_skins/erp5_core/Alarm_zGarbageCollectDeletedCatalog.sql
+2
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_zGarbageCollectDeletedCatalog.xml
...l_skins/erp5_core/Alarm_zGarbageCollectDeletedCatalog.xml
+28
-0
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Core.py
View file @
2d42a55c
...
...
@@ -788,3 +788,15 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
len
(
self
.
portal
.
z_get_deleted_path_list
(
timestamp
=
DateTime
()
-
1
)),
len
(
person_list
),
)
# make some rows in deleted_catalog older.
query
=
self
.
portal
.
erp5_sql_connection
().
query
query
(
'UPDATE deleted_catalog SET deletion_timestamp="%s" LIMIT 5'
%
\
(
DateTime
()
-
10
).
strftime
(
'%Y-%m-%d'
)
)
self
.
portal
.
portal_alarms
.
alarm_garbage_collect_deleted_catalog
.
activeSense
()
self
.
tic
()
# check if old raws are removed from deleted_catalog.
self
.
assertEqual
(
len
(
self
.
portal
.
z_get_deleted_path_list
(
timestamp
=
DateTime
()
-
1
)),
len
(
person_list
)
-
5
,
)
product/ERP5/bootstrap/erp5_core/PathTemplateItem/portal_alarms/alarm_garbage_collect_deleted_catalog.xml
0 → 100644
View file @
2d42a55c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_zGarbageCollectDeletedCatalog
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
alarm_garbage_collect_deleted_catalog
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_day_frequency
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<tuple>
<float>
946692180.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_zGarbageCollectDeletedCatalog.sql
0 → 100644
View file @
2d42a55c
DELETE
FROM
deleted_catalog
WHERE
deletion_timestamp
<
DATE_ADD
(
NOW
(),
INTERVAL
-
1
WEEK
)
\ No newline at end of file
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_zGarbageCollectDeletedCatalog.xml
0 → 100644
View file @
2d42a55c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"SQL"
module=
"Products.ZSQLMethods.SQL"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
arguments_src
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
connection_id
</string>
</key>
<value>
<string>
erp5_sql_connection
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_zGarbageCollectDeletedCatalog
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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