Skip to content

Commit

Permalink
fix(cloudconfig): Log errors and continue (#4118)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncknt authored and ethanfrogers committed Oct 28, 2019
1 parent fa202f1 commit 1bbbf53
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
import com.netflix.spinnaker.cats.thread.NamedThreadFactory;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.refresh.ContextRefresher;

/**
* Refresh the Spring Cloud Config context on a schedule. The configured interval should
* approximately match the cache refresh interval.
*/
@Slf4j
public class CloudConfigRefreshScheduler implements Runnable {
private final ContextRefresher contextRefresher;

Expand All @@ -38,6 +40,10 @@ public CloudConfigRefreshScheduler(ContextRefresher contextRefresher, long inter

@Override
public void run() {
contextRefresher.refresh();
try {
contextRefresher.refresh();
} catch (Throwable t) {
log.error("Error refreshing cloud config", t);
}
}
}

0 comments on commit 1bbbf53

Please sign in to comment.