Skip to content

Commit

Permalink
Merge pull request pencilblue#1239 from LeandroZacarias/fix-cache-mul…
Browse files Browse the repository at this point in the history
…ti-tenancy

Fix cache on multi-tenancy
  • Loading branch information
brianhyder authored Mar 12, 2017
2 parents 24d9379 + fb7ca50 commit f0bce64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/service/cache_entity_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = function CacheEntityServiceModule(pb) {
CacheEntityService.prototype.get = function(key, cb){

var self = this;
pb.cache.get(keyValue(key, this.site), function(err, result){
pb.cache.get(keyValue(key, self.site), function(err, result){
if (util.isError(err)) {
return cb(err, null);
}
Expand Down Expand Up @@ -132,7 +132,7 @@ module.exports = function CacheEntityServiceModule(pb) {
*/
CacheEntityService.prototype.set = function(key, value, cb) {
var self = this;
pb.cache.get(keyValue(key, this.site), function(err, result){
pb.cache.get(keyValue(key, self.site), function(err, result){
if (util.isError(err)) {
return cb(err, null);
}
Expand Down Expand Up @@ -163,10 +163,10 @@ module.exports = function CacheEntityServiceModule(pb) {

//set into cache
if (self.timeout) {
pb.cache.setex(key, self.timeout, val, cb);
pb.cache.setex(keyValue(key, self.site), self.timeout, val, cb);
}
else {
pb.cache.set(key, val, cb);
pb.cache.set(keyValue(key, self.site), val, cb);
}
});
};
Expand Down

0 comments on commit f0bce64

Please sign in to comment.