Skip to content

Commit

Permalink
Confirm maxmind database has loaded before registering hook. (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
lnedry authored May 11, 2024
1 parent 6cb2cc2 commit 4bf024b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,9 @@ exports.test_and_register_geoip = async function () {

try {
this.maxmind = require('maxmind');
await this.load_dbs()
this.register_hook('connect', 'lookup_via_maxmind');
if (await this.load_dbs()) {
this.register_hook('connect', 'lookup_via_maxmind');
}
}
catch (e) {
this.logerror(e);
Expand Down

0 comments on commit 4bf024b

Please sign in to comment.