Unverified Commit e28862d8 authored by lgcareer's avatar lgcareer Committed by GitHub
Browse files

Merge pull request #353 from lgcareer/branch-1.0.2

Determine if a node exists before deleting it
parents ae8076a7 8a4fe1d8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -206,7 +206,10 @@ public class TaskQueueZkImpl extends AbstractZKClient implements ITaskQueue {
        String taskIdPath = tasksQueuePath + nodeValue;
        logger.info("consume task {}", taskIdPath);
        try{
            Stat stat = zk.checkExists().forPath(taskIdPath);
            if(stat != null){
                zk.delete().forPath(taskIdPath);
            }
        }catch(Exception e){
            logger.error(String.format("delete task:%s from zookeeper fail, exception:" ,nodeValue) ,e);
        }