Skip to content

Commit

Permalink
support reload interval
Browse files Browse the repository at this point in the history
  • Loading branch information
YeautyYE committed Oct 17, 2019
1 parent 38aefb3 commit 75b5e66
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void updateNginxFromNacos(File configFile) throws IOException, Interrupte
logger.warn("incorrect parameter :{} ", RELOAD_INTERVAL);
}
while (true) {
if (lastReloadTime.get() == 0L || System.currentTimeMillis() - lastReloadTime.get() < interval) {
if (lastReloadTime.get() == 0L || (System.currentTimeMillis() - lastReloadTime.get()) < interval) {
try {
TimeUnit.MILLISECONDS.sleep(interval);
continue;
Expand All @@ -128,6 +128,7 @@ public void updateNginxFromNacos(File configFile) throws IOException, Interrupte
logger.error("nginx reload incorrect , execute [{}] to get detail ", (cmd + " -s reload"));
return;
}
lastReloadTime.set(0L);
logger.info("nginx reload success!");
} catch (Exception e) {
logger.error("reload nginx throw exception", e);
Expand Down

0 comments on commit 75b5e66

Please sign in to comment.