Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
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
曲欣亮
shop
Commits
67c60961
Commit
67c60961
authored
Oct 13, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化搜索引擎接口,计划任务
parent
8abd95d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
SolrGoodsController.java
...n/java/com/egolm/shop/controller/SolrGoodsController.java
+3
-3
SolrGoodsService.java
src/main/java/com/egolm/shop/service/SolrGoodsService.java
+1
-1
SolrGoodsServiceImpl.java
...ava/com/egolm/shop/service/impl/SolrGoodsServiceImpl.java
+4
-1
No files found.
src/main/java/com/egolm/shop/controller/SolrGoodsController.java
View file @
67c60961
...
...
@@ -72,17 +72,17 @@ public class SolrGoodsController {
if
(
this
.
getLock
().
getCode
()
==
200
)
{
try
{
service
.
update
(
null
);
return
Rjx
.
jsonOk
();
}
finally
{
this
.
releaseLock
();
}
}
else
{
return
Rjx
.
jsonErr
().
setMessage
(
"该任务正在运行,请不要重复执行"
);
}
return
Rjx
.
jsonOk
();
}
p
rivate
static
final
String
SCHEDULE_LOCK_KEY
=
"SCHEDULE_LOCK_KEY"
;
p
rivate
static
final
long
SCHEDULE_LOCK_EXPIRE
=
100
0
*
60
;
p
ublic
static
final
String
SCHEDULE_LOCK_KEY
=
"SCHEDULE_LOCK_KEY"
;
p
ublic
static
Long
SCHEDULE_LOCK_EXPIRE
=
1000L
*
6
0
*
60
;
@ResponseBody
@PostMapping
(
"getLock"
)
...
...
src/main/java/com/egolm/shop/service/SolrGoodsService.java
View file @
67c60961
...
...
@@ -4,7 +4,7 @@ import com.egolm.common.bean.Rjx;
import
com.egolm.common.jdbc.Page
;
public
interface
SolrGoodsService
{
public
Rjx
query
(
Page
page
,
String
queryKey
,
String
[]
keywords
,
String
[]
facetFields
,
String
[]
facetPivotFields
);
public
void
update
(
String
sDistrictID
);
...
...
src/main/java/com/egolm/shop/service/impl/SolrGoodsServiceImpl.java
View file @
67c60961
...
...
@@ -34,6 +34,7 @@ import com.egolm.common.bean.Rjx;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.shop.config.XException
;
import
com.egolm.shop.controller.SolrGoodsController
;
import
com.egolm.shop.service.SolrGoodsService
;
@Service
...
...
@@ -168,6 +169,7 @@ public class SolrGoodsServiceImpl implements SolrGoodsService {
@Async
public
void
update
(
String
sDistrictID
)
{
Long
start
=
System
.
currentTimeMillis
();
List
<
String
>
strs
=
new
ArrayList
<
String
>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
if
(
StringUtil
.
isBlank
(
sDistrictID
))
{
...
...
@@ -320,6 +322,7 @@ public class SolrGoodsServiceImpl implements SolrGoodsService {
}
}
}
SolrGoodsController
.
SCHEDULE_LOCK_EXPIRE
=
System
.
currentTimeMillis
()
-
start
;;
}
}
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