summaryrefslogtreecommitdiff
path: root/server/src/async.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/async.lua')
-rw-r--r--server/src/async.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/async.lua b/server/src/async.lua
index 01c6c3ac..24e8b538 100644
--- a/server/src/async.lua
+++ b/server/src/async.lua
@@ -21,7 +21,12 @@ local errlog = thread.channel 'errlog'
local function task()
local dump, env = request:bpop()
- local f, err = load(dump, '=task', 't', env or _ENV)
+ if env then
+ setmetatable(env, { __index = _ENV })
+ else
+ env = _ENV
+ end
+ local f, err = load(dump, '=task', 't', env)
if not f then
errlog:push(err)
return