Software /
code /
prosody
Comparison
core/storagemanager.lua @ 6811:82350a06df6e
Merge 0.10->trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 02 Sep 2015 18:55:35 +0100 |
parent | 6792:8b284787fe26 |
parent | 6809:dd6b21862e3b |
child | 6952:db085e55555f |
comparison
equal
deleted
inserted
replaced
6801:5032d4817a30 | 6811:82350a06df6e |
---|---|
132 local function purge(user, host) | 132 local function purge(user, host) |
133 local storage = config.get(host, "storage"); | 133 local storage = config.get(host, "storage"); |
134 if type(storage) == "table" then | 134 if type(storage) == "table" then |
135 -- multiple storage backends in use that we need to purge | 135 -- multiple storage backends in use that we need to purge |
136 local purged = {}; | 136 local purged = {}; |
137 for store, driver in pairs(storage) do | 137 for store, driver_name in pairs(storage) do |
138 if not purged[driver] then | 138 if not purged[driver_name] then |
139 purged[driver] = get_driver(host, store):purge(user); | 139 local driver = get_driver(host, store); |
140 if driver.purge then | |
141 purged[driver_name] = driver:purge(user); | |
142 else | |
143 log("warn", "Storage driver %s does not support removing all user data, you may need to delete it manually", driver_name); | |
144 end | |
140 end | 145 end |
141 end | 146 end |
142 end | 147 end |
143 get_driver(host):purge(user); -- and the default driver | 148 get_driver(host):purge(user); -- and the default driver |
144 | 149 |
170 return { | 175 return { |
171 initialize_host = initialize_host; | 176 initialize_host = initialize_host; |
172 load_driver = load_driver; | 177 load_driver = load_driver; |
173 get_driver = get_driver; | 178 get_driver = get_driver; |
174 open = open; | 179 open = open; |
180 purge = purge; | |
175 | 181 |
176 olddm = olddm; | 182 olddm = olddm; |
177 }; | 183 }; |