Skip to content

Commit

Permalink
fix: correctly cache semanticType
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Aug 6, 2021
1 parent 270cb76 commit 7d21651
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cache_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ module.exports = class {
constructor(qEdges, caching, logs = []) {
this.qEdges = qEdges;
this.logs = logs;
this.cacheEnabled = (caching === 'false') ?
false :
(!(process.env.REDIS_HOST === undefined) && !(process.env.REDIS_PORT === undefined));
this.cacheEnabled =
caching === 'false' ? false : !(process.env.REDIS_HOST === undefined) && !(process.env.REDIS_PORT === undefined);
this.logs.push(
new LogEntry('DEBUG', null, `REDIS cache is ${this.cacheEnabled === true ? '' : 'not'} enabled.`).getLog(),
);
Expand Down Expand Up @@ -59,6 +58,7 @@ module.exports = class {
curies: record.$input.obj[0].curies,
label: record.$input.obj[0].label,
primaryID: record.$input.obj[0].primaryID,
semanticType: record.$input.obj[0].semanticType,
},
],
},
Expand All @@ -70,6 +70,7 @@ module.exports = class {
curies: record.$output.obj[0].curies,
label: record.$output.obj[0].label,
primaryID: record.$output.obj[0].primaryID,
semanticType: record.$input.obj[0].semanticType,
},
],
},
Expand Down

0 comments on commit 7d21651

Please sign in to comment.