Skip to content
Snippets Groups Projects
Commit 44dc0b00 authored by Mingyang Zhu's avatar Mingyang Zhu
Browse files

make azure custom readiness redis check optional

parent 8bcca6a1
No related branches found
No related tags found
1 merge request!53customized readiness check to make sure cache layer is ready before serving traffic
......@@ -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");
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment