You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2021/11/16 07:23:00 UTC
[servicecomb-java-chassis] branch master updated: [SCB-2357]when kie client long polling not enabled will pull configurations immediately (#2637)
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new cc0f570 [SCB-2357]when kie client long polling not enabled will pull configurations immediately (#2637)
cc0f570 is described below
commit cc0f5709d94d2f895a55851cf9d64babc712fa86
Author: liubao68 <bi...@qq.com>
AuthorDate: Tue Nov 16 15:22:57 2021 +0800
[SCB-2357]when kie client long polling not enabled will pull configurations immediately (#2637)
---
.../apache/servicecomb/config/kie/client/KieConfigManager.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/clients/config-kie-client/src/main/java/org/apache/servicecomb/config/kie/client/KieConfigManager.java b/clients/config-kie-client/src/main/java/org/apache/servicecomb/config/kie/client/KieConfigManager.java
index 298a2c0..11e0666 100644
--- a/clients/config-kie-client/src/main/java/org/apache/servicecomb/config/kie/client/KieConfigManager.java
+++ b/clients/config-kie-client/src/main/java/org/apache/servicecomb/config/kie/client/KieConfigManager.java
@@ -39,7 +39,9 @@ public class KieConfigManager extends AbstractTask {
private static final Logger LOGGER = LoggerFactory.getLogger(KieConfigManager.class);
- private static long POLL_INTERVAL = 1000;
+ private static long LONG_POLLING_INTERVAL = 1000;
+
+ private static long POLLING_INTERVAL = 15000;
private KieConfigOperation configKieClient;
@@ -128,9 +130,9 @@ public class KieConfigManager extends AbstractTask {
onDataChanged();
}
if (KieConfigManager.this.kieConfiguration.isEnableLongPolling()) {
- startTask(new BackOffSleepTask(POLL_INTERVAL, new PollConfigurationTask(0, this.configurationsRequest)));
+ startTask(new BackOffSleepTask(LONG_POLLING_INTERVAL, new PollConfigurationTask(0, this.configurationsRequest)));
} else {
- startTask(new PollConfigurationTask(0, this.configurationsRequest));
+ startTask(new BackOffSleepTask(POLLING_INTERVAL, new PollConfigurationTask(0, this.configurationsRequest)));
}
} catch (Exception e) {
LOGGER.error("get configurations from KieConfigCenter failed, and will try again.", e);