Fix the error in determining the type of deleted metadata

This commit is contained in:
KomachiSion 2020-12-08 18:00:46 +08:00
parent cd7a2d0ce6
commit 8877bd3460

View File

@ -67,11 +67,11 @@ public class ExpiredMetadataCleaner extends AbstractNamingCleaner {
Loggers.SRV_LOG.info("Remove expired metadata {}", expiredInfo);
if (null == expiredInfo.getInstanceId()) {
if (metadataManager.containServiceMetadata(expiredInfo.getService())) {
metadataOperateService.deleteInstanceMetadata(expiredInfo.getService(), expiredInfo.getInstanceId());
metadataOperateService.deleteServiceMetadata(expiredInfo.getService());
}
} else {
if (metadataManager.containInstanceMetadata(expiredInfo.getService(), expiredInfo.getInstanceId())) {
metadataOperateService.deleteServiceMetadata(expiredInfo.getService());
metadataOperateService.deleteInstanceMetadata(expiredInfo.getService(), expiredInfo.getInstanceId());
}
}
}