Skip to content

Commit 212eb6a

Browse files
author
bravemaster619
committed
fix: fix cache hit check in fetch method
Issue #203 Comment #203 (comment) 58
1 parent df0287e commit 212eb6a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

_src/lib/node_cache.coffee

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,8 @@ module.exports = class NodeCache extends EventEmitter
215215
#
216216
fetch: ( key, ttl, value )=>
217217
# check if cache is hit
218-
_ret = @get( key )
219-
if _ret?
220-
return _ret
218+
if @has( key )
219+
return @get( key )
221220
if typeof value == 'undefined'
222221
value = ttl
223222
ttl = undefined

0 commit comments

Comments
 (0)