MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / decrement

Method decrement

src/utils/database.js:115–126  ·  view source on GitHub ↗
(key, amount = 1)

Source from the content-addressed store, hash-verified

113 }
114
115 async decrement(key, amount = 1) {
116 if (this.useFallback) {
117 logger.debug(`[DEGRADED] Decrementing in memory: ${key}`);
118 }
119 if (this.db.decrement) {
120 return this.db.decrement(key, amount);
121 }
122 const current = await this.db.get(key, 0);
123 const newValue = current - amount;
124 await this.db.set(key, newValue);
125 return newValue;
126 }
127
128 isDegraded() {
129 return this.useFallback;

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected