Skip to content

Commit

Permalink
Release v1.2.5 (#67)
Browse files Browse the repository at this point in the history
- Remove expired rate_conn hash keys (#66)
  • Loading branch information
msimerson authored Jul 17, 2024
1 parent 89b4769 commit 3debdf6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This handcrafted artisinal software is brought to you by:

| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/haraka/haraka-plugin-limit/commits?author=msimerson">71</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/48183131?v=4"><br><a href="https://github.com/divine">divine</a> (<a href="https://github.com/haraka/haraka-plugin-limit/commits?author=divine">6</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/82041?v=4"><br><a href="https://github.com/gramakri">gramakri</a> (<a href="https://github.com/haraka/haraka-plugin-limit/commits?author=gramakri">3</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/28440072?v=4"><br><a href="https://github.com/leadbi">leadbi</a> (<a href="https://github.com/haraka/haraka-plugin-limit/commits?author=leadbi">1</a>) |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/haraka/haraka-plugin-limit/commits?author=msimerson">72</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/48183131?v=4"><br><a href="https://github.com/divine">divine</a> (<a href="https://github.com/haraka/haraka-plugin-limit/commits?author=divine">6</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/82041?v=4"><br><a href="https://github.com/gramakri">gramakri</a> (<a href="https://github.com/haraka/haraka-plugin-limit/commits?author=gramakri">3</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/28440072?v=4"><br><a href="https://github.com/leadbi">leadbi</a> (<a href="https://github.com/haraka/haraka-plugin-limit/commits?author=leadbi">1</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/1105174?v=4"><br><a href="https://github.com/jonmz">jonmz</a> (<a href="https://github.com/haraka/haraka-plugin-limit/commits?author=jonmz">1</a>) |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is maintained by [.release](https://github.com/msimerson/.release)</sub>
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit 3debdf6

Please sign in to comment.