Skip to content

Commit

Permalink
chore: ignore lint and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-pr-p committed Jan 30, 2020
1 parent b90796b commit dadae1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "memoredis",
"version": "1.0.5",
"version": "1.0.6",
"description": "Redis memoization library with good Typescript generics, locking, and argument-wide bulk invalidation",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down
6 changes: 5 additions & 1 deletion src/lib/memoizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const createMemoizer = (instanceOpts: MemoizerOpts) => {
});

const psetex = (key: string, milliseconds: number, value: any) =>
// tslint:disable-next-line: variable-name
new Promise((resolve, _reject) => {
let jsonValue;
try {
Expand All @@ -94,13 +95,16 @@ export const createMemoizer = (instanceOpts: MemoizerOpts) => {
});

const get = <T>(key: string): Promise<T | null> =>
// tslint:disable-next-line: variable-name
new Promise((resolve, _reject) =>
client.get(key, (err, reply) => {
if (err) {
logger.error(`memoredis: redis error getting key ${key}.`, err);
return resolve(null);
}
if (reply === null) return resolve(null);
if (reply === null) {
return resolve(null);
}

try {
return resolve(JSON.parse(reply, jsonDateParser) as T);
Expand Down

0 comments on commit dadae1b

Please sign in to comment.