From be01f326599aa4c2589f3fb6d2f88871e2c69b30 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Wed, 30 Aug 2017 15:29:39 +0800 Subject: [PATCH] update code --- .../platform/operate/web/utils/SendMysqlSyncDatUtil.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/SendMysqlSyncDatUtil.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/SendMysqlSyncDatUtil.java index cffb169..3ddaea2 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/SendMysqlSyncDatUtil.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/SendMysqlSyncDatUtil.java @@ -23,6 +23,8 @@ import java.util.concurrent.TimeUnit; @Component public class SendMysqlSyncDatUtil implements InitializingBean { + public static final String run_mode = PropertiesUtils.getPropertyValue("run.mode"); + private static BlockingQueue syncSqlQueue = new LinkedBlockingQueue(500); //配置文件中配置的要同步的区域的url地址 @@ -56,14 +58,18 @@ public class SendMysqlSyncDatUtil implements InitializingBean { /** * 初始化启动发送sql的线程 + * 线上才启动 * @throws Exception */ @Override public void afterPropertiesSet() throws Exception { - System.out.println("init ........."); - Thread thread = new HandleThread(); - thread.setName("syncMysqlThread"); - thread.start(); + if ("2".equals(run_mode)) + { + System.out.println("init ........."); + Thread thread = new HandleThread(); + thread.setName("syncMysqlThread"); + thread.start(); + } } -- 1.8.3.1