iteration

This commit is contained in:
Layla 2023-10-08 04:23:25 -04:00
parent 510bc2b2a9
commit 282f209217

View File

@ -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