Skip to content

Commit 346ca82

Browse files
committed
fix lint error
1 parent 6edb7b2 commit 346ca82

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apisix/balancer.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@
1414
-- See the License for the specific language governing permissions and
1515
-- limitations under the License.
1616
--
17+
local healthcheck
18+
local require = require
1719
local roundrobin = require("resty.roundrobin")
1820
local discovery = require("apisix.discovery.init").discovery
1921
local resty_chash = require("resty.chash")
2022
local balancer = require("ngx.balancer")
2123
local core = require("apisix.core")
22-
local healthcheck = require("resty.healthcheck")
2324
local error = error
2425
local str_char = string.char
2526
local str_gsub = string.gsub
2627
local pairs = pairs
2728
local ipairs = ipairs
2829
local tostring = tostring
30+
2931
local set_more_tries = balancer.set_more_tries
3032
local get_last_failure = balancer.get_last_failure
3133
local set_timeouts = balancer.set_timeouts
@@ -82,6 +84,9 @@ end
8284

8385

8486
local function create_checker(upstream, healthcheck_parent)
87+
if healthcheck == nil then
88+
healthcheck = require("resty.healthcheck")
89+
end
8590
local checker = healthcheck.new({
8691
name = "upstream#" .. healthcheck_parent.key,
8792
shm_name = "upstream-healthcheck",

0 commit comments

Comments
 (0)