Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
This repository was archived by the owner on May 30, 2024. It is now read-only.

Not able to fetch variation from redis persistent store #169

@vgupta

Description

@vgupta

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions