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

Method put

src/Adapters/Cache/InMemoryCache.js:25–42  ·  view source on GitHub ↗
(key, value, ttl = this.ttl)

Source from the content-addressed store, hash-verified

23 }
24
25 put(key, value, ttl = this.ttl) {
26 if (ttl < 0 || isNaN(ttl)) {
27 ttl = NaN;
28 }
29
30 var record = {
31 value: value,
32 expire: ttl + Date.now(),
33 };
34
35 if (!isNaN(record.expire)) {
36 record.timeout = setTimeout(() => {
37 this.del(key);
38 }, ttl);
39 }
40
41 this.cache[key] = record;
42 }
43
44 del(key) {
45 var record = this.cache[key];

Callers

nothing calls this directly

Calls 1

delMethod · 0.95

Tested by

no test coverage detected