diff --git a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/policy/GovernancePolicy.java b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/policy/GovernancePolicy.java index 497dad26e..f39632f3a 100644 --- a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/policy/GovernancePolicy.java +++ b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/policy/GovernancePolicy.java @@ -315,7 +315,7 @@ public List onUpdate(List updates, Set deletes, Policy result.add(old); } } - } else if (old.getVersion() < update.getVersion()) { + } else if (old.getVersion() != update.getVersion()) { // Update ServiceOp.onUpdate(old, update, merger, owner); result.add(old); diff --git a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/policy/listener/ServiceListener.java b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/policy/listener/ServiceListener.java index be74a2dad..1f56bce24 100644 --- a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/policy/listener/ServiceListener.java +++ b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/policy/listener/ServiceListener.java @@ -68,7 +68,7 @@ protected void updateItems(GovernancePolicy policy, List items, ConfigE loadedServices.add(item.getName()); newVersions.put(item.getName(), item.getVersion()); long oldVersion = oldVersions.getOrDefault(item.getName(), -1L); - if (item.getVersion() > oldVersion) { + if (item.getVersion() != oldVersion) { updates.add(item); } }