mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +01:00
Don't poll plugins that don't support polling.
This commit is contained in:
@@ -45,12 +45,13 @@ class PollerImpl implements Poller {
|
|||||||
|
|
||||||
public void addPlugin(Plugin p) {
|
public void addPlugin(Plugin p) {
|
||||||
// Randomise first polling interval
|
// Randomise first polling interval
|
||||||
schedule(p, randomise(p.getPollingInterval()), false);
|
if (p.shouldPoll())
|
||||||
|
schedule(p, randomise(p.getPollingInterval()), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pollNow(Plugin p) {
|
public void pollNow(Plugin p) {
|
||||||
// Randomise next polling interval
|
// Randomise next polling interval
|
||||||
schedule(p, 0, true);
|
if (p.shouldPoll()) schedule(p, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int randomise(int interval) {
|
private int randomise(int interval) {
|
||||||
|
|||||||
Reference in New Issue
Block a user