Commit 44dc0b00 authored by Mingyang Zhu's avatar Mingyang Zhu
Browse files

make azure custom readiness redis check optional

parent 8bcca6a1
......@@ -2,11 +2,11 @@ package org.opengroup.osdu.partition.provider.azure.service;
import lombok.RequiredArgsConstructor;
import org.opengroup.osdu.partition.model.PartitionInfo;
import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache;
import org.opengroup.osdu.partition.service.DefaultHealthCheckImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
......@@ -19,11 +19,17 @@ public class HealthCheckServiceImpl extends DefaultHealthCheckImpl {
@Qualifier("partitionServiceCache")
private IPartitionServiceCache<String, PartitionInfo> partitionServiceCache;
@Value("${redis.custom.readiness.check.enabled}")
private boolean redisCustomReadinessCheck;
/**
* Cache layer must be ready before the pod can serve the traffic
*/
@Override
public void performReadinessCheck() {
partitionServiceCache.get("dummy-key");
if (redisCustomReadinessCheck) {
partitionServiceCache.get("dummy-key");
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment