Commit ab277a32 authored by 赵啸非's avatar 赵啸非

优化窗口业务查询

parent 14ea80a5
...@@ -10,11 +10,12 @@ import com.mortals.xhx.module.page.service.PageRouteService; ...@@ -10,11 +10,12 @@ import com.mortals.xhx.module.page.service.PageRouteService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import static com.mortals.xhx.common.key.RedisKey.KEY_BURY_POINT_CACHE; import static com.mortals.xhx.common.key.RedisKey.KEY_BURY_POINT_CACHE;
//@Component @Component
@Slf4j @Slf4j
public class ComsumerBurySaveService implements IApplicationStartedService { public class ComsumerBurySaveService implements IApplicationStartedService {
...@@ -36,14 +37,17 @@ public class ComsumerBurySaveService implements IApplicationStartedService { ...@@ -36,14 +37,17 @@ public class ComsumerBurySaveService implements IApplicationStartedService {
Thread sendThread = new Thread(new Runnable() { Thread sendThread = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
int waitTime = 1; int waitTime = 10;
while (!stopped) { while (!stopped) {
try { try {
BuryPointPdu pdu = cacheService.lpop(KEY_BURY_POINT_CACHE, BuryPointPdu.class); BuryPointPdu pdu = cacheService.lpop(KEY_BURY_POINT_CACHE, BuryPointPdu.class);
pageAccessService.saveByPdu(pdu); if(!ObjectUtils.isEmpty(pdu)){
pageAccessDepthService.saveByPdu(pdu); pageAccessService.saveByPdu(pdu);
pageEventService.saveByPdu(pdu); pageAccessDepthService.saveByPdu(pdu);
pageRouteService.saveByPdu(pdu); pageEventService.saveByPdu(pdu);
pageRouteService.saveByPdu(pdu);
}
try { try {
Thread.sleep(waitTime); Thread.sleep(waitTime);
} catch (InterruptedException e2) { } catch (InterruptedException e2) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment