From 356ef4ff817747438529384569aa84a7fbdbe61f Mon Sep 17 00:00:00 2001 From: Vladislav Grubov Date: Fri, 10 Jun 2022 17:32:48 +0400 Subject: [PATCH] fix callable config.etcd --- config/etcd.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/etcd.lua b/config/etcd.lua index 42b85f1..e83f83a 100644 --- a/config/etcd.lua +++ b/config/etcd.lua @@ -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'} @@ -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 = {}