Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huangzhicong
/
SmartCanteen
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
39d1ab31
authored
May 09, 2020
by
pye52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复数据库清理的细节问题
parent
bf2438fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
app/src/main/java/com/bgycc/smartcanteen/worker/DatabaseMonitor.java
+12
-9
No files found.
app/src/main/java/com/bgycc/smartcanteen/worker/DatabaseMonitor.java
View file @
39d1ab31
...
...
@@ -36,28 +36,31 @@ public class DatabaseMonitor extends Worker {
builder
.
append
(
"\n"
)
.
append
(
"command数据库当前旧数据量: "
)
.
append
(
commandCount
);
if
(
commandCount
>
=
DATABASE_LIMIT
)
{
commandRepository
.
clearOldData
(
DATABASE_LIMIT
);
if
(
commandCount
>
DATABASE_LIMIT
)
{
int
clearCount
=
commandRepository
.
clearOldData
(
commandCount
-
DATABASE_LIMIT
);
builder
.
append
(
"\n"
)
.
append
(
"command数据库已清理旧数据"
);
.
append
(
"command数据库已清理旧数据: "
)
.
append
(
clearCount
);
}
int
payDataCount
=
payDataRepository
.
countOldData
();
builder
.
append
(
"\n"
)
.
append
(
"payData数据库当前旧数据量: "
)
.
append
(
payDataCount
);
if
(
payDataCount
>
=
DATABASE_LIMIT
)
{
payDataRepository
.
clearOldData
(
DATABASE_LIMIT
);
if
(
payDataCount
>
DATABASE_LIMIT
)
{
int
clearCount
=
payDataRepository
.
clearOldData
(
payDataCount
-
DATABASE_LIMIT
);
builder
.
append
(
"\n"
)
.
append
(
"payData数据库已清理旧数据"
);
.
append
(
"payData数据库已清理旧数据: "
)
.
append
(
clearCount
);
}
int
payResponseCount
=
payResponseRepository
.
countOldData
();
builder
.
append
(
"\n"
)
.
append
(
"payResponse数据库当前旧数据量: "
)
.
append
(
payResponseCount
);
if
(
payResponseCount
>
=
DATABASE_LIMIT
)
{
payResponseRepository
.
clearOldData
(
DATABASE_LIMIT
);
if
(
payResponseCount
>
DATABASE_LIMIT
)
{
int
clearCount
=
payResponseRepository
.
clearOldData
(
payResponseCount
-
DATABASE_LIMIT
);
builder
.
append
(
"\n"
)
.
append
(
"payResponse数据库已清理旧数据"
);
.
append
(
"payResponse数据库已清理旧数据: "
)
.
append
(
clearCount
);
}
LogUtils
.
d
(
TAG
,
builder
);
return
Result
.
success
();
...
...
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