Skip to content

Commit 353cbc1

Browse files
committed
fix timer block
1 parent f71265e commit 353cbc1

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

script/service/service.lua

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,13 @@ function m.eventLoop()
165165
end
166166

167167
local function doSomething()
168+
timer.update()
168169
pub.step(false)
169-
if not await.step() then
170-
return false
170+
if await.step() then
171+
busy()
172+
return true
171173
end
172-
busy()
173-
return true
174+
return false
174175
end
175176

176177
local function sleep()
@@ -185,10 +186,6 @@ function m.eventLoop()
185186
end
186187

187188
while true do
188-
if doSomething() then
189-
goto CONTINUE
190-
end
191-
timer.update()
192189
if doSomething() then
193190
goto CONTINUE
194191
end

0 commit comments

Comments
 (0)