Skip to content

Commit c5c1111

Browse files
committed
Dont use raw string for config var name
1 parent 5d36bc7 commit c5c1111

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

config.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ local function etcd_load( M, etcd_conf, local_cfg )
546546

547547
local local_cache_needed = etcd_conf.local_cache
548548
local local_cache_used = false
549+
local local_cache_var = '\0moonlibs.config.etcd_cache'
549550

550551
function M.etcd.get_common(e)
551552
local common_cfg = e:list(prefix .. "/common")
@@ -595,7 +596,7 @@ local function etcd_load( M, etcd_conf, local_cfg )
595596
end
596597

597598
function M.etcd.get_all_from_cache(e)
598-
return rawget(_G, '\0moonlibs.config.etcd_cache')
599+
return rawget(_G, local_cache_var)
599600
end
600601

601602
local ok, discovery_err = pcall(etcd.discovery, etcd)
@@ -613,7 +614,7 @@ local function etcd_load( M, etcd_conf, local_cfg )
613614
else
614615
all_cfg = etcd:get_all()
615616
if local_cache_needed then
616-
rawset(_G, '\0moonlibs.config.etcd_cache', all_cfg)
617+
rawset(_G, local_cache_var, all_cfg)
617618
end
618619
end
619620

0 commit comments

Comments
 (0)