From 282f209217c6620f88fa6606ef3d2fdbe1a8f965 Mon Sep 17 00:00:00 2001 From: Layla Manley Date: Sun, 8 Oct 2023 04:23:25 -0400 Subject: [PATCH] iteration --- lib/lns.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/lns.lua b/lib/lns.lua index 2f702d7..0bee2bd 100644 --- a/lib/lns.lua +++ b/lib/lns.lua @@ -1,4 +1,5 @@ local cache = {} +local cache_file = "/var/cache/lns_cache.db" settings.define("lns_client.allow_dynamic_lns_hosts", { description = "Allow dynamic LNS hosts", @@ -14,8 +15,8 @@ settings.define("lns_client.lns_server", { function _load_cache() - if fs.exists("lns_cache.db") then - db = fs.open("lns_cache.db", "r") + if fs.exists(cache_file) then + db = fs.open(cache_file, "r") db_contents = db.readAll() db.close() @@ -24,7 +25,7 @@ function _load_cache() end function _save_cache() - db = fs.open("lns_cache.db", "w") + db = fs.open(cache_file, "w") db.write(textutils.serialize(cache)) db.close() end