lua - fix pcall for asn/country mmdb lookup

This commit is contained in:
bunkerity 2022-08-25 10:33:09 +02:00
parent 04019a617a
commit 6afdb298fa
No known key found for this signature in database
GPG Key ID: 3D80806F12602A7C
2 changed files with 6 additions and 6 deletions

View File

@ -374,10 +374,10 @@ jobs:
run: cat /opt/.runner_env >> $GITHUB_ENV
# Run tests
# - name: Run Docker tests
# run: ./tests/main.py "docker"
# - name: Run Autoconf tests
# run: ./tests/main.py "autoconf"
- name: Run Docker tests
run: ./tests/main.py "docker"
- name: Run Autoconf tests
run: ./tests/main.py "autoconf"
- name: Run Swarm tests
run: ./tests/main.py "swarm"
- name: Run Kubernetes tests

View File

@ -317,7 +317,7 @@ utils.get_country = function(ip)
if not mmdb.country_db then
return false, "mmdb country not loaded"
end
local ok, result, err = pcall(mmdb.country_db:lookup(ip))
local ok, result, err = pcall(mmdb.country_db.lookup, mmdb.country_db, ip)
if not ok then
return nil, result
end
@ -331,7 +331,7 @@ utils.get_asn = function(ip)
if not mmdb.asn_db then
return false, "mmdb asn not loaded"
end
local ok, result, err = pcall(mmdb.asn_db:lookup(ip))
local ok, result, err = pcall(mmdb.asn_db.lookup, mmdb.asn_db, ip)
if not ok then
return nil, result
end