aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-12-12 06:15:08 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-12-12 06:15:08 +0500
commit6771ad9d2998f4589ebacb819b89f133fb8c7970 (patch)
tree55d366e206953b5de26d1a915a823c6846b6452f /core
parent49298b499e5018526c6b95b3d81585bfe5cb710f (diff)
downloadprosody-6771ad9d2998f4589ebacb819b89f133fb8c7970.tar.gz
prosody-6771ad9d2998f4589ebacb819b89f133fb8c7970.zip
storagemanager: When we have a cached data driver, we are supposed to use it.
Diffstat (limited to 'core')
-rw-r--r--core/storagemanager.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index db540042..e0c12190 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -44,13 +44,12 @@ local function load_driver(host, driver_name)
return;
end
local driver = stores_available:get(host, driver_name);
- if not driver then
- if driver_name ~= "internal" then
- modulemanager.load(host, "storage_"..driver_name);
- return stores_available:get(host, driver_name);
- else
- return setmetatable({host = host}, default_driver_mt);
- end
+ if driver then return driver; end
+ if driver_name ~= "internal" then
+ modulemanager.load(host, "storage_"..driver_name);
+ return stores_available:get(host, driver_name);
+ else
+ return setmetatable({host = host}, default_driver_mt);
end
end