Skip to content

Commit ef263ec

Browse files
authored
initialize redis when only concurrency is enabled (#42)
1 parent 7d69fd5 commit ef263ec

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ exports.register = function () {
1010
let needs_redis = 0
1111

1212
if (this.cfg.concurrency.enabled) {
13+
needs_redis++;
1314
this.register_hook('connect_init', 'conn_concur_incr');
1415
this.register_hook('connect', 'check_concurrency');
1516
this.register_hook('disconnect', 'conn_concur_decr');
@@ -30,25 +31,25 @@ exports.register = function () {
3031
}
3132

3233
if (this.cfg.rate_conn.enabled) {
33-
needs_redis++
34+
needs_redis++;
3435
this.register_hook('connect_init', 'rate_conn_incr');
3536
this.register_hook('connect', 'rate_conn_enforce');
3637
}
3738
if (this.cfg.rate_rcpt_host.enabled) {
38-
needs_redis++
39+
needs_redis++;
3940
this.register_hook('connect', 'rate_rcpt_host_enforce');
4041
this.register_hook('rcpt', 'rate_rcpt_host_incr');
4142
}
4243
if (this.cfg.rate_rcpt_sender.enabled) {
43-
needs_redis++
44+
needs_redis++;
4445
this.register_hook('rcpt', 'rate_rcpt_sender');
4546
}
4647
if (this.cfg.rate_rcpt_null.enabled) {
47-
needs_redis++
48+
needs_redis++;
4849
this.register_hook('rcpt', 'rate_rcpt_null');
4950
}
5051
if (this.cfg.rate_rcpt.enabled) {
51-
needs_redis++
52+
needs_redis++;
5253
this.register_hook('rcpt', 'rate_rcpt');
5354
}
5455

0 commit comments

Comments
 (0)