Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FeatureCacheProviderRedis #69

Closed
bhanushe opened this issue Nov 18, 2015 · 1 comment
Closed

Fix FeatureCacheProviderRedis #69

bhanushe opened this issue Nov 18, 2015 · 1 comment

Comments

@bhanushe
Copy link

Currently, the constructor for FeatureCacheProviderRedis accepts 2 parameters but uses defaults while creating new Jedis object.

public FeatureCacheProviderRedis(String host, int port) {
    jedis = new Jedis(redisHost, redisport);
}

Kindly update the constructor to use the parameters.

The method below uses a prefix to search for cache keys.

@Override
public Set<String> listCachedFeatureNames() {
    return jedis.keys(PREFIX_KEY + "*");
}

I believe the presence of the prefix "PREFIX_KEY" may be an error. The "put" method does not use the prefix to cache the feature. Hence this method returns empty set unless it is backed by a Redis feature store (which is not correct, as in that case it return the actual feature rather than the cached feature)

@bhanushe bhanushe changed the title Fix FeatureCacheProviderRedis contructor Fix FeatureCacheProviderRedis Nov 19, 2015
@clun
Copy link
Collaborator

clun commented Nov 29, 2015

Your were right in both cases.

The constructor is now corrected.

I committed a "new" jcache store which lead to a bit of changes in all caches. (Unfortunately Redis is not yet compliant with JCache). Anyway I kept the prefix everywhere to be able to distinct features and properties.

@clun clun closed this as completed Nov 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants