diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d32af8..645ee92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Unreleased +### [1.2.5] - 2024-07-16 + +- fix: remove expired rate_conn hash keys (#66) + ### [1.2.4] - 2024-06-09 - Fix max_recipients loop iterator (introduced in 2c5fdd49) #63 @@ -87,3 +91,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). [1.2.2]: https://github.com/haraka/haraka-plugin-limit/releases/tag/v1.2.2 [1.2.3]: https://github.com/haraka/haraka-plugin-limit/releases/tag/v1.2.3 [1.2.4]: https://github.com/haraka/haraka-plugin-limit/releases/tag/v1.2.4 +[1.2.5]: https://github.com/haraka/haraka-plugin-limit/releases/tag/v1.2.5 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 20dae39..75e4a18 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,7 +2,7 @@ This handcrafted artisinal software is brought to you by: -|
msimerson (71) |
divine (6) |
gramakri (3) |
leadbi (1) | -| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +|
msimerson (72) |
divine (6) |
gramakri (3) |
leadbi (1) |
jonmz (1) | +| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | this file is maintained by [.release](https://github.com/msimerson/.release) diff --git a/index.js b/index.js index a60cad2..787afe3 100644 --- a/index.js +++ b/index.js @@ -480,7 +480,6 @@ exports.rate_conn_incr = async function (next, connection) { // extend key expiration on every new connection await this.db.expire(`rate_conn:${key}`, getTTL(value) * 2) } catch (err) { - console.error(err) connection.results.add(this, { err }) } next() @@ -511,8 +510,9 @@ exports.rate_conn_enforce = async function (next, connection) { let connections_in_ttl_period = 0 for (const ts of Object.keys(tstamps)) { - if (parseInt(ts, 10) < periodStartTs) { // older than ttl - this.db.hDel(`rate_conn:${key}`, ts); + if (parseInt(ts, 10) < periodStartTs) { + // older than ttl + this.db.hDel(`rate_conn:${key}`, ts) continue } connections_in_ttl_period = diff --git a/package.json b/package.json index df08158..5a34f79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "haraka-plugin-limit", - "version": "1.2.4", + "version": "1.2.5", "description": "enforce various types of limits on remote MTAs", "main": "index.js", "files": [