Commit ddb563f2a4d233823d00bccf209875f1ad1a972f

Authored by liquanyu
1 parent b4dccc7656

同步

Showing 2 changed files with 5 additions and 8 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/MysqlDataInterceptor.java View file @ ddb563f
... ... @@ -3,7 +3,6 @@
3 3  
4 4 import com.lyms.platform.biz.service.SyncDataService;
5 5 import com.lyms.platform.common.utils.ExceptionUtils;
6   -import com.lyms.platform.operate.web.utils.SendMysqlSyncDatUtil;
7 6 import org.apache.commons.collections.CollectionUtils;
8 7 import org.apache.commons.lang.StringUtils;
9 8 import org.apache.ibatis.executor.Executor;
10 9  
... ... @@ -78,8 +77,9 @@
78 77 if (isSyncTable(sql))
79 78 {
80 79 System.out.println("==============delete or update sync sql = " + sql);
  80 + //syncDataService.savePostMysql(sql,sqlId);
81 81 sql = null;
82   - syncDataService.savePostMysql(sql,sqlId);
  82 +
83 83 }
84 84 }
85 85 else if ("insert".equals(sqlCommandType.toLowerCase()) )
86 86  
... ... @@ -100,10 +100,9 @@
100 100 if (returnValue != null && returnValue instanceof ArrayList)
101 101 {
102 102 List<Integer> list = (ArrayList)returnValue;
103   - if (CollectionUtils.isNotEmpty(list))
104   - {
  103 + if (CollectionUtils.isNotEmpty(list)) {
105 104 System.out.println("============add sync sql = " + sql);
106   - syncDataService.savePostMysql(sql,sqlId);
  105 +// syncDataService.savePostMysql(sql,sqlId);
107 106 sql = null;
108 107 }
109 108 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/SendMysqlSyncDatUtil.java View file @ ddb563f
... ... @@ -14,7 +14,6 @@
14 14 import java.util.Set;
15 15 import java.util.concurrent.BlockingQueue;
16 16 import java.util.concurrent.LinkedBlockingQueue;
17   -import java.util.concurrent.TimeUnit;
18 17  
19 18 /**
20 19 * Created by lqy
21 20  
... ... @@ -23,9 +22,8 @@
23 22 @Component
24 23 public class SendMysqlSyncDatUtil implements InitializingBean {
25 24  
26   - public static final String run_mode = PropertiesUtils.getPropertyValue("run.mode");
27 25  
28   - private static BlockingQueue<SqlRequest> syncSqlQueue = new LinkedBlockingQueue(500);
  26 + private static BlockingQueue<SqlRequest> syncSqlQueue = new LinkedBlockingQueue(200);
29 27  
30 28 //配置文件中配置的要同步的区域的url地址
31 29 private static Set<String> urls = new HashSet<>();