aboutsummaryrefslogtreecommitdiffstats
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
commitc3e87cc5f3a4893510bd5b42bcd4856dae44227d (patch)
treed3defb0cea81a30f5d21be553a9a72bd92f0b297
parentd6ce1c7e2a0e857ef575e999b4db2fb911650f5d (diff)
downloadprosody-c3e87cc5f3a4893510bd5b42bcd4856dae44227d.tar.gz
prosody-c3e87cc5f3a4893510bd5b42bcd4856dae44227d.zip
storagemanager: When we have a cached data driver, we are supposed to use it.
-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