summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-05-10 17:07:16 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-05-10 17:07:16 +0800
commitdf024326ff24a6581606e6f532c211f3516ad33b (patch)
tree72a243d99eea4034feced68b55cd954f3168c4db /script
parent43e375b7dd2a9c4e8e3e02cca51f546e38d79b31 (diff)
downloadlua-language-server-df024326ff24a6581606e6f532c211f3516ad33b.zip
漏了一处
Diffstat (limited to 'script')
-rw-r--r--script/pub/pub.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/script/pub/pub.lua b/script/pub/pub.lua
index e8051d05..517c3fc7 100644
--- a/script/pub/pub.lua
+++ b/script/pub/pub.lua
@@ -12,11 +12,14 @@ end
local function channel_bpop(ctx)
local selector, chan = ctx[1], ctx[2]
- for _ in selector:wait() do
- local r = table.pack(chan:pop())
- if r[1] == true then
- return table.unpack(r, 2)
+ while true do
+ for _ in selector:wait() do
+ local r = table.pack(chan:pop())
+ if r[1] == true then
+ return table.unpack(r, 2)
+ end
end
+ thread.sleep(10)
end
end