Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
suggest-task
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
田川
suggest-task
Commits
a2551f78
Commit
a2551f78
authored
Jan 10, 2023
by
徐鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'TECH-search-fix' into 'master'
修正临时文件一直追加问题 See merge request
!6
parents
c8a7957b
619f3d94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
QueryPlanHelper.java
suggest-task/src/main/java/com/secoo/so/suggest/helper/QueryPlanHelper.java
+3
-1
No files found.
suggest-task/src/main/java/com/secoo/so/suggest/helper/QueryPlanHelper.java
View file @
a2551f78
...
...
@@ -117,9 +117,11 @@ public class QueryPlanHelper {
}
long
nowSecond
=
System
.
currentTimeMillis
()/
1000
;
long
sevenDays
=
3600
*
24
*
7
;
boolean
appendToFile
=
true
;
if
(
nowSecond
-
minTimeStamp
>
sevenDays
)
{
// 文件中最早的时间戳超过7天,全量更新;否则只更新新增的
if
(
keywordMap
.
size
()
>
0
)
{
appendToFile
=
false
;
newWordLines
=
new
ArrayList
<>();
// map转存到newWordLines
for
(
Map
.
Entry
<
String
,
Integer
>
entry
:
keywordMap
.
entrySet
())
{
String
line
=
entry
.
getKey
()
+
","
+
entry
.
getValue
()
+
","
+
nowSecond
;
...
...
@@ -129,7 +131,7 @@ public class QueryPlanHelper {
}
}
if
(
newWordLines
!=
null
&&
newWordLines
.
size
()
>
0
)
{
FileUtils
.
saveToFile
(
newWordLines
,
queryPlanFile
,
tru
e
);
FileUtils
.
saveToFile
(
newWordLines
,
queryPlanFile
,
appendToFil
e
);
newWordLines
=
new
ArrayList
<>();
}
}
...
...
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