MCPcopy Index your code
hub / github.com/parse-community/parse-server / put

Method put

src/Adapters/Cache/RedisCacheAdapter.js:58–75  ·  view source on GitHub ↗
(key, value, ttl = this.ttl)

Source from the content-addressed store, hash-verified

56 }
57
58 async put(key, value, ttl = this.ttl) {
59 value = JSON.stringify(value);
60 debug('put', { key, value, ttl });
61 await this.queue.enqueue(key);
62 if (ttl === 0) {
63 // ttl of zero is a logical no-op, but redis cannot set expire time of zero
64 return;
65 }
66
67 if (ttl === Infinity) {
68 return this.client.set(key, value);
69 }
70
71 if (!isValidTTL(ttl)) {
72 ttl = this.ttl;
73 }
74 return this.client.set(key, value, { PX: ttl });
75 }
76
77 async del(key) {
78 debug('del', { key });

Callers

nothing calls this directly

Calls 3

isValidTTLFunction · 0.85
debugFunction · 0.70
enqueueMethod · 0.45

Tested by

no test coverage detected