Commit be01f326599aa4c2589f3fb6d2f88871e2c69b30
1 parent
2423e4df80
Exists in
master
and in
6 other branches
update code
Showing 1 changed file with 10 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/SendMysqlSyncDatUtil.java
View file @
be01f32
| ... | ... | @@ -23,6 +23,8 @@ |
| 23 | 23 | @Component |
| 24 | 24 | public class SendMysqlSyncDatUtil implements InitializingBean { |
| 25 | 25 | |
| 26 | + public static final String run_mode = PropertiesUtils.getPropertyValue("run.mode"); | |
| 27 | + | |
| 26 | 28 | private static BlockingQueue<SqlRequest> syncSqlQueue = new LinkedBlockingQueue(500); |
| 27 | 29 | |
| 28 | 30 | //配置文件中配置的要同步的区域的url地址 |
| 29 | 31 | |
| ... | ... | @@ -56,14 +58,18 @@ |
| 56 | 58 | |
| 57 | 59 | /** |
| 58 | 60 | * 初始化启动发送sql的线程 |
| 61 | + * 线上才启动 | |
| 59 | 62 | * @throws Exception |
| 60 | 63 | */ |
| 61 | 64 | @Override |
| 62 | 65 | public void afterPropertiesSet() throws Exception { |
| 63 | - System.out.println("init ........."); | |
| 64 | - Thread thread = new HandleThread(); | |
| 65 | - thread.setName("syncMysqlThread"); | |
| 66 | - thread.start(); | |
| 66 | + if ("2".equals(run_mode)) | |
| 67 | + { | |
| 68 | + System.out.println("init ........."); | |
| 69 | + Thread thread = new HandleThread(); | |
| 70 | + thread.setName("syncMysqlThread"); | |
| 71 | + thread.start(); | |
| 72 | + } | |
| 67 | 73 | } |
| 68 | 74 | |
| 69 | 75 |