diff options
-rw-r--r-- | aconf/persistence/backends/null.lua | 2 | ||||
-rw-r--r-- | aconf/persistence/init.lua | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/aconf/persistence/backends/null.lua b/aconf/persistence/backends/null.lua index 770e5e8..5210c92 100644 --- a/aconf/persistence/backends/null.lua +++ b/aconf/persistence/backends/null.lua @@ -4,7 +4,7 @@ See LICENSE file for license details --]] local backend = require('aconf.object').class() -function backend:get(path, top) if #path == 0 then return {} end end +function backend:get(path, top) return #path == 0 and {} or nil, 0 end function backend:set(mods) end return backend diff --git a/aconf/persistence/init.lua b/aconf/persistence/init.lua index c1398fa..bcc1f0e 100644 --- a/aconf/persistence/init.lua +++ b/aconf/persistence/init.lua @@ -45,7 +45,7 @@ function DataStore:get(path) local backend, comps = self:split_path(path) local top = topology(path) - local value = backend:get(comps, top) + local value, ts = backend:get(comps, top) if top then local t = top.type @@ -80,7 +80,7 @@ function DataStore:get(path) end end - return util.copy(value), self.mod_time[path] or 0 + return util.copy(value), ts or self.mod_time[path] or 0 end function DataStore:_set_multiple(mods) |