From 73502acd1d8c2d3bdd0275c3ae185549faa3dc7f Mon Sep 17 00:00:00 2001 From: chenlw <874313221@qq.com> Date: Wed, 4 Jan 2017 14:01:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88=E3=80=82=E5=86=8D?= =?UTF-8?q?=E5=8E=BB=E8=BF=81=E7=A7=BB=E5=90=8C=E4=B8=80=E4=BB=BD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A4=B1=E8=B4=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/platform/service/thread/ThreadMoveData.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/com/platform/service/thread/ThreadMoveData.java b/src/com/platform/service/thread/ThreadMoveData.java index ed7350a4..63728914 100644 --- a/src/com/platform/service/thread/ThreadMoveData.java +++ b/src/com/platform/service/thread/ThreadMoveData.java @@ -38,6 +38,8 @@ public class ThreadMoveData{ public final static Logger log = Logger.getLogger(ThreadMoveData.class); + private static boolean iscontinue = false; + @Resource(name = "dataInfoDao") private DataInfoDao dataInfoDao; @@ -71,6 +73,10 @@ public class ThreadMoveData{ //迁移数据 -- 2016-11-30后 使用 @Scheduled(fixedDelay = 4000) public void moveDataByWebGfs(){ + if (iscontinue) { + return; + } + iscontinue = true; List result = new ArrayList(); Map volumeMap = new HashMap(); try { @@ -96,6 +102,7 @@ public class ThreadMoveData{ } catch (Exception e) { log.error(e); } + iscontinue = false; } //5秒 //2016-11-30后 不使用 @@ -370,8 +377,11 @@ public class ThreadMoveData{ //请求迁移 curMoveNum++; //TODO 判断 moveE.getDataPath()的空间大小 和 makeDstPath(moveE.getDstPath())的大小 + //迁移 try { - if(1==copy.copyFolder(moveE.getDataPath(), makeDstPath(moveE.getDstPath()))){ + int copyResult = copy.copyFolder(moveE.getDataPath(), makeDstPath(moveE.getDstPath())); + log.info("httpclient copyFolder result: "+copyResult); + if(1== copyResult){ moveE.setCompleteStatus("1"); } else {