aboutsummaryrefslogtreecommitdiffstats
path: root/core/storagemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-12-03 14:47:47 +0000
committerMatthew Wild <mwild1@gmail.com>2015-12-03 14:47:47 +0000
commitfb55a7df98190568bc93ef889967148ecc2b5ec4 (patch)
tree11324bac7375981f767f439527cc6338bc5ba387 /core/storagemanager.lua
parenta62c6fb6b99a0f25d7d3298fc5851a95e921fda8 (diff)
downloadprosody-fb55a7df98190568bc93ef889967148ecc2b5ec4.tar.gz
prosody-fb55a7df98190568bc93ef889967148ecc2b5ec4.zip
storagemanager: Split config retrieval into its own function
Diffstat (limited to 'core/storagemanager.lua')
-rw-r--r--core/storagemanager.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index fb868d03..21f5fd1d 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -57,8 +57,12 @@ local function load_driver(host, driver_name)
return stores_available:get(host, driver_name);
end
+local function get_storage_config(host)
+ return config.get(host, "storage");
+end
+
local function get_driver(host, store)
- local storage = config.get(host, "storage");
+ local storage = get_storage_config(host);
local driver_name;
local option_type = type(storage);
if option_type == "string" then
@@ -94,7 +98,7 @@ local function open(host, store, typ)
end
local function purge(user, host)
- local storage = config.get(host, "storage");
+ local storage = get_storage_config(host);
if type(storage) == "table" then
-- multiple storage backends in use that we need to purge
local purged = {};