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

Method increment

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

Source from the content-addressed store, hash-verified

100 }
101
102 async increment(key, amount = 1) {
103 if (this.useFallback) {
104 logger.debug(`[DEGRADED] Incrementing in memory: ${key}`);
105 }
106 if (this.db.increment) {
107 return this.db.increment(key, amount);
108 }
109 const current = await this.db.get(key, 0);
110 const newValue = current + amount;
111 await this.db.set(key, newValue);
112 return newValue;
113 }
114
115 async decrement(key, amount = 1) {
116 if (this.useFallback) {

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected