(key: string)
| 95 | } |
| 96 | |
| 97 | async resetKey(key: string): Promise<void> { |
| 98 | if (!isDatabaseInitialized()) return; |
| 99 | const prefixedKey = this.prefix + key; |
| 100 | try { |
| 101 | await query(`DELETE FROM rate_limit_hits WHERE key = $1`, [prefixedKey]); |
| 102 | } catch (err) { |
| 103 | logger.warn({ err, key: prefixedKey }, 'Rate limit resetKey failed'); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | async resetAll(): Promise<void> { |
| 108 | if (!isDatabaseInitialized()) return; |
no test coverage detected