MCPcopy Create free account
hub / github.com/parse-community/parse-server / get

Method get

src/Adapters/Cache/InMemoryCache.js:9–23  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

7 }
8
9 get(key) {
10 const record = this.cache[key];
11 if (record == null) {
12 return null;
13 }
14
15 // Has Record and isnt expired
16 if (isNaN(record.expire) || record.expire >= Date.now()) {
17 return record.value;
18 }
19
20 // Record has expired
21 delete this.cache[key];
22 return null;
23 }
24
25 put(key, value, ttl = this.ttl) {
26 if (ttl < 0 || isNaN(ttl)) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected