comparison mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 4551:b92147edd172

mod_storage_xmlarchive: Workaround for #1646 (util.async bug with Lua 5.1)
author Kim Alvefur <zash@zash.se>
date Mon, 26 Apr 2021 02:49:06 +0200
parents 591c643d55b2
children 072d078be095
comparison
equal deleted inserted replaced
4550:0befc680970b 4551:b92147edd172
130 local ok, err = dm.list_store(username.."@"..day, self.host, self.store, items); 130 local ok, err = dm.list_store(username.."@"..day, self.host, self.store, items);
131 return ok, err; 131 return ok, err;
132 end 132 end
133 133
134 local function get_nexttick() 134 local function get_nexttick()
135 if async.ready() then 135 -- COMPAT util.async under Lua 5.1 runs into problems trying to yield across
136 -- pcall barriers. Workaround for #1646
137 if _VERSION ~= "Lua 5.1" and async.ready() then
136 return function () 138 return function ()
137 -- slow down 139 -- slow down
138 local wait, done = async.waiter(); 140 local wait, done = async.waiter();
139 module:add_timer(0, done); 141 module:add_timer(0, done);
140 wait(); 142 wait();