()
| 105 | } |
| 106 | |
| 107 | async resetAll(): Promise<void> { |
| 108 | if (!isDatabaseInitialized()) return; |
| 109 | try { |
| 110 | if (this.prefix) { |
| 111 | await query(`DELETE FROM rate_limit_hits WHERE key LIKE $1`, [this.prefix + '%']); |
| 112 | } else { |
| 113 | await query(`DELETE FROM rate_limit_hits`); |
| 114 | } |
| 115 | } catch (err) { |
| 116 | logger.warn({ err }, 'Rate limit resetAll failed'); |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | interface CachedEntry { |
nothing calls this directly
no test coverage detected