Skip to content

Commit

Permalink
Update index.js (#26)
Browse files Browse the repository at this point in the history
switch from using this.redis_pings in favor of this.redis_ping(), related to #23
  • Loading branch information
ainesophaur authored Nov 22, 2022
1 parent 77913ea commit 17ae5ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ exports.rcpt = async function (next, connection, params) {
}

// if we can't use redis, try files
if (!this.redis_pings) {
if (!!this.db && ! await this.redis_ping() ) {
return next(await this.do_file_search(txn, address, domain));
}



// redis connection open, try it
next(await this.do_redis_search(connection, address, domain))
}
Expand Down Expand Up @@ -164,7 +166,7 @@ exports.get_mx = async function (next, hmail, domain) {
}

// if we can't use redis, try files and return
if (!this.redis_pings) {
if (!! this.db && ! await this.redis_ping() ) {
this.get_mx_file(address, domain, next);
return;
}
Expand Down

0 comments on commit 17ae5ae

Please sign in to comment.