diff --git a/src/main/java/com/inspect/simulator/InspectSimulatorApplication.java b/src/main/java/com/inspect/simulator/InspectSimulatorApplication.java index 0500c00..70f326f 100644 --- a/src/main/java/com/inspect/simulator/InspectSimulatorApplication.java +++ b/src/main/java/com/inspect/simulator/InspectSimulatorApplication.java @@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.context.annotation.Bean; import org.springframework.scheduling.annotation.EnableScheduling; import retrofit2.Retrofit; @@ -17,6 +18,7 @@ import retrofit2.converter.scalars.ScalarsConverterFactory; @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) @EnableScheduling +@RefreshScope public class InspectSimulatorApplication { private final static Logger log = LoggerFactory.getLogger(InspectSimulatorApplication.class); diff --git a/src/main/java/com/inspect/simulator/service/impl/PatrolResultServiceImpl.java b/src/main/java/com/inspect/simulator/service/impl/PatrolResultServiceImpl.java index 3d663a3..3a2ba44 100644 --- a/src/main/java/com/inspect/simulator/service/impl/PatrolResultServiceImpl.java +++ b/src/main/java/com/inspect/simulator/service/impl/PatrolResultServiceImpl.java @@ -20,6 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import retrofit2.Call; @@ -33,6 +34,7 @@ import java.util.concurrent.*; import java.util.stream.Collectors; @Service +@RefreshScope public class PatrolResultServiceImpl implements PatrolResultService { @Value("${upper.stationCode:30000001-112967078}")