I have two microservices. One microservice is connecting with launchdarly and storing all flags in redis using redis persistance store. Example
let sdk_key = "sdk_key";
const redisOpts = {
url: 'redis://localhost:6379'
};
const store = LaunchDarkly.RedisFeatureStore(redisOpts, 30, 'my-key-prefix');
const config = {
featureStore: store
};
var ldClient = LaunchDarkly.init(sdk_key, config);
await ldClient.waitForInitialization();
ldClient.variation("testflag", { "key": "keyvalue" }, false,
function (err, showFeature) {
if (showFeature) {
console.log("show");
// application code to show the feature
} else {
console.log("hide");
// the code to run if the feature is off
}
});
I verified redis database and database has testflag and corresponding value.
I have another microservice that is trying to fetch variation from redis persistance store but i am not getting same value of 'showFeature' as above example.
let sdk_key = "sdk_key";
const redisOpts = {
url: 'redis://localhost:6379'
};
const store = LaunchDarkly.RedisFeatureStore(redisOpts, null, 'my-key-prefix');
const config = {
featureStore: store,
useLdd:true
};
var ldClient = LaunchDarkly.init(sdk_key, config);
await ldClient.waitForInitialization();
ldClient.variation("testflag", { "key": "keyvalue" }, false,
function (err, showFeature) {
if (showFeature) {
console.log("show");
// application code to show the feature
} else {
console.log("hide");
// the code to run if the feature is off
}
});
can you check and fix this.