Software /
code /
prosody
Changeset
6949:1c2c3d913172
storagemanager: Split config retrieval into its own function
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 03 Dec 2015 14:47:47 +0000 |
parents | 6948:e6968e47826d |
children | 6950:8ab809358922 |
files | core/storagemanager.lua |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/core/storagemanager.lua Thu Dec 03 15:27:09 2015 +0100 +++ b/core/storagemanager.lua Thu Dec 03 14:47:47 2015 +0000 @@ -57,8 +57,12 @@ 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 @@ 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 = {};