Software /
code /
prosody
Comparison
core/storagemanager.lua @ 3734:ec59071e2a55
storagemanager: When we have a cached data driver, we are supposed to use it.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 12 Dec 2010 06:15:08 +0500 |
parent | 3728:b1b8fe846d68 |
child | 3770:4de73ae45163 |
comparison
equal
deleted
inserted
replaced
3733:26571a99f6e6 | 3734:ec59071e2a55 |
---|---|
42 local function load_driver(host, driver_name) | 42 local function load_driver(host, driver_name) |
43 if not driver_name then | 43 if not driver_name then |
44 return; | 44 return; |
45 end | 45 end |
46 local driver = stores_available:get(host, driver_name); | 46 local driver = stores_available:get(host, driver_name); |
47 if not driver then | 47 if driver then return driver; end |
48 if driver_name ~= "internal" then | 48 if driver_name ~= "internal" then |
49 modulemanager.load(host, "storage_"..driver_name); | 49 modulemanager.load(host, "storage_"..driver_name); |
50 return stores_available:get(host, driver_name); | 50 return stores_available:get(host, driver_name); |
51 else | 51 else |
52 return setmetatable({host = host}, default_driver_mt); | 52 return setmetatable({host = host}, default_driver_mt); |
53 end | |
54 end | 53 end |
55 end | 54 end |
56 | 55 |
57 function open(host, store, typ) | 56 function open(host, store, typ) |
58 local storage = config.get(host, "core", "storage"); | 57 local storage = config.get(host, "core", "storage"); |