Don't poll plugins that don't support polling.

This commit is contained in:
akwizgran
2016-04-06 10:20:55 +01:00
parent 90f3d33f86
commit 04a1f2b12c

View File

@@ -45,12 +45,13 @@ class PollerImpl implements Poller {
public void addPlugin(Plugin p) {
// Randomise first polling interval
schedule(p, randomise(p.getPollingInterval()), false);
if (p.shouldPoll())
schedule(p, randomise(p.getPollingInterval()), false);
}
public void pollNow(Plugin p) {
// Randomise next polling interval
schedule(p, 0, true);
if (p.shouldPoll()) schedule(p, 0, true);
}
private int randomise(int interval) {