Object cache refactor (#7558)

* fix: cache refactor

db.getObjectField no longer loads entire object
db.getObjectsFields only clones data once
more tests

* feat: add back cache to redis

db.getObjectField no longer loads entire object
This commit is contained in:
Barış Soner Uşaklı
2019-04-24 14:38:46 -04:00
committed by GitHub
parent e81a1dbb65
commit 2c98dd5f9d
5 changed files with 180 additions and 98 deletions

View File

@@ -65,7 +65,7 @@ VALUES ($1::TEXT, jsonb_build_object($2::TEXT, $3::TEXT::JSONB))
module.getObject = function (key, callback) {
if (!key) {
return callback();
return callback(null, null);
}
db.query({
@@ -122,7 +122,7 @@ SELECT h."data"
module.getObjectField = function (key, field, callback) {
if (!key) {
return callback();
return setImmediate(callback, null, null);
}
db.query({
@@ -151,7 +151,7 @@ SELECT h."data"->>$2::TEXT f
module.getObjectFields = function (key, fields, callback) {
if (!key) {
return callback();
return setImmediate(callback, null, null);
}
db.query({