From e6f69695bbfde029621b826f05cae1e773d8984a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Van=C4=8Do?= Date: Fri, 27 Oct 2023 09:42:17 +0200 Subject: [PATCH] Add clearExpiredByTimeout to RateLimiterPostgres.js when table is created If there is not a reason this is missing and MySQL has it, then Postgres should support this, too. --- lib/RateLimiterPostgres.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/RateLimiterPostgres.js b/lib/RateLimiterPostgres.js index 48cdd74..9e60adc 100644 --- a/lib/RateLimiterPostgres.js +++ b/lib/RateLimiterPostgres.js @@ -48,6 +48,9 @@ class RateLimiterPostgres extends RateLimiterStoreAbstract { } }); } else { + if (this.clearExpiredByTimeout) { + this._clearExpiredHourAgo(); + } if (typeof cb === 'function') { cb(); }