package com.ctrip.zeus.task.config;

import com.ctrip.zeus.service.update.SlbServerConfManager;
import com.ctrip.zeus.task.AbstractTask;
import com.netflix.config.DynamicIntProperty;
import com.netflix.config.DynamicPropertyFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by fanqq on 2016/3/17.
 */
@Component("slbServerConfUpdateTask")
public class SlbServerConfUpdateTask extends AbstractTask {
    @Resource
    private SlbServerConfManager slbServerConfManager;

    private Logger logger = LoggerFactory.getLogger(this.getClass());
    private static DynamicIntProperty interval = DynamicPropertyFactory.getInstance().getIntProperty("slb.server.conf.update.task.interval", 30000);

    @Override
    public void start() {

    }

    @Override
    public void run() throws Exception {
        try{
            slbServerConfManager.update();
        }catch (Exception e){
            logger.error("[SlbServerConfUpdateTask] Execute Failed.",e);
        }
    }

    @Override
    public void stop() {

    }

    @Override
    public long getInterval() {
        return interval.get();
    }
}

@@ -912,16 +912,17 @@
      try
+ 
 %7B%0A      
@@ -955,16 +955,28 @@
 .update(
+false, false
 );%0A     
@@ -979,16 +979,17 @@
        %7D
+ 
 catch (E
@@ -999,16 +999,17 @@
 ption e)
+ 
 %7B%0A      
@@ -1071,16 +1071,17 @@
 ailed.%22,
+ 
 e);%0A    

fix slb config update task