Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
quantum-blocks
Commits
b54ea60a
Commit
b54ea60a
authored
Oct 28, 2022
by
徐光星
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加定时任务删除历史记录表一年前的数据
parent
dddab3dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
records.ts
app/service/records.ts
+2
-2
No files found.
app/service/records.ts
View file @
b54ea60a
...
@@ -7,8 +7,8 @@ export default class RecordsService extends Service {
...
@@ -7,8 +7,8 @@ export default class RecordsService extends Service {
this
.
context
=
ctx
;
this
.
context
=
ctx
;
}
}
async
clearInvalidPageHistoryRecords
()
{
async
clearInvalidPageHistoryRecords
()
{
// 操作记录表直接删除
半
年以上的操作记录
// 操作记录表直接删除
一
年以上的操作记录
const
limitDate
=
new
Date
(
new
Date
().
getTime
()
-
180
*
24
*
3600
*
1000
).
toLocaleDateString
().
replace
(
/
\/
/g
,
'
-
'
)
const
limitDate
=
new
Date
(
new
Date
().
getTime
()
-
365
*
24
*
3600
*
1000
).
toLocaleDateString
().
replace
(
/
\/
/g
,
'
-
'
)
try
{
try
{
this
.
context
.
logger
.
info
(
`开始删除页面历史记录,删除范围为日期在
${
limitDate
}
之前的所有记录`
);
this
.
context
.
logger
.
info
(
`开始删除页面历史记录,删除范围为日期在
${
limitDate
}
之前的所有记录`
);
await
this
.
context
.
model
.
PageHistory
.
destroy
({
await
this
.
context
.
model
.
PageHistory
.
destroy
({
...
...
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