Merge pull request #776 from darkness463/develop
[ISSUE #768] Fix: client beat interval is not controlled by server.
This commit is contained in:
commit
ee9447c388
@ -31,7 +31,7 @@ public class BeatReactor {
|
|||||||
|
|
||||||
private ScheduledExecutorService executorService;
|
private ScheduledExecutorService executorService;
|
||||||
|
|
||||||
private long clientBeatInterval = 5 * 1000;
|
private volatile long clientBeatInterval = 5 * 1000;
|
||||||
|
|
||||||
private NamingProxy serverProxy;
|
private NamingProxy serverProxy;
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ public class BeatReactor {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
executorService.scheduleAtFixedRate(new BeatProcessor(), 0, clientBeatInterval, TimeUnit.MILLISECONDS);
|
executorService.schedule(new BeatProcessor(), 0, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addBeatInfo(String dom, BeatInfo beatInfo) {
|
public void addBeatInfo(String dom, BeatInfo beatInfo) {
|
||||||
@ -88,6 +88,8 @@ public class BeatReactor {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtils.LOG.error("CLIENT-BEAT", "Exception while scheduling beat.", e);
|
LogUtils.LOG.error("CLIENT-BEAT", "Exception while scheduling beat.", e);
|
||||||
|
} finally {
|
||||||
|
executorService.schedule(this, clientBeatInterval, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user