Skip to content

Commit

Permalink
fix callable config.etcd
Browse files Browse the repository at this point in the history
  • Loading branch information
ochaton authored Jun 10, 2022
1 parent 95e5f02 commit 356ef4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/etcd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ function M.errstr(code)
return M.err[ tonumber(code) ] or string.format("Unknown error %s",code)
end

setmetatable(M,{ __call = M.new })

function M.new(mod,options)
local self = setmetatable({},{__index=mod})
self.endpoints = options.endpoints or {'http://127.0.0.1:4001','http://127.0.0.1:2379'}
Expand All @@ -46,6 +44,8 @@ function M.new(mod,options)
return self
end

setmetatable(M,{ __call = M.new })

function M:discovery()
local timeout = self.timeout or 1
local new_endpoints = {}
Expand Down

0 comments on commit 356ef4f

Please sign in to comment.