Comparison

util/datamanager.lua @ 8101:3e25d96571d1

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 20 Apr 2017 00:41:49 +0200
parent 8092:0a1c0f1107d2
child 8299:756a2a00e7e7
comparison
equal deleted inserted replaced
8091:acecf1413233 8101:3e25d96571d1
266 data = {}; 266 data = {};
267 end 267 end
268 if callback(username, host, datastore) == false then return true; end 268 if callback(username, host, datastore) == false then return true; end
269 -- save the datastore 269 -- save the datastore
270 local d = {}; 270 local d = {};
271 for _, item in ipairs(data) do 271 for i, item in ipairs(data) do
272 d[#d+1] = "item(" .. serialize(item) .. ");\n"; 272 d[i] = "item(" .. serialize(item) .. ");\n";
273 end 273 end
274 local ok, msg = atomic_store(getpath(username, host, datastore, "list", true), t_concat(d)); 274 local ok, msg = atomic_store(getpath(username, host, datastore, "list", true), t_concat(d));
275 if not ok then 275 if not ok then
276 log("error", "Unable to write to %s storage ('%s') for user: %s@%s", datastore, msg, username or "nil", host or "nil"); 276 log("error", "Unable to write to %s storage ('%s') for user: %s@%s", datastore, msg, username or "nil", host or "nil");
277 return; 277 return;