diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-12-03 14:47:47 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-12-03 14:47:47 +0000 |
commit | fcb1c816a1e438767815d0829208d3c0df868743 (patch) | |
tree | 11324bac7375981f767f439527cc6338bc5ba387 | |
parent | 1f7a51cd5e147fc3801725ad0ac01f47b2d5a9dd (diff) | |
download | prosody-fcb1c816a1e438767815d0829208d3c0df868743.tar.gz prosody-fcb1c816a1e438767815d0829208d3c0df868743.zip |
storagemanager: Split config retrieval into its own function
-rw-r--r-- | core/storagemanager.lua | 8 |
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 = {}; |