Commit dd3478d1 by 袁伟铭

1.0.0

parent 4f29e256
...@@ -10,8 +10,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; ...@@ -10,8 +10,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableAsync @EnableAsync
@EnableScheduling
@EnableFeignClients @EnableFeignClients
@MapperScan("com.zq.api.dao") @MapperScan("com.zq.api.dao")
@EnableDiscoveryClient @EnableDiscoveryClient
......
...@@ -28,6 +28,10 @@ public class FeignConfig { ...@@ -28,6 +28,10 @@ public class FeignConfig {
if (headerNames != null) { if (headerNames != null) {
while (headerNames.hasMoreElements()) { while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement(); String name = headerNames.nextElement();
// 跳过content-length
if (name.equals("content-length")) {
continue;
}
String values = request.getHeader(name); String values = request.getHeader(name);
template.header(name, values); template.header(name, values);
} }
......
package com.zq.api.task;
import com.zq.api.config.ConfigCache;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
@RequiredArgsConstructor
public class ConfigTask {
@Scheduled(cron = "0/5 * * * * ?")
public void updateConfig() {
ConfigCache.init();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment