[PATCH compass-ci] extract-stats: add Fiber.yield after spawn operation

12 Apr
2021
12 Apr
'21
2:09 p.m.
Signed-off-by: Cao Xueliang <caoxl78320@163.com> --- src/extract-stats/extract_stats.cr | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/extract-stats/extract_stats.cr b/src/extract-stats/extract_stats.cr index c35d3ec..89cd89e 100644 --- a/src/extract-stats/extract_stats.cr +++ b/src/extract-stats/extract_stats.cr @@ -42,8 +42,7 @@ module ExtractStats task = tasks.delete_at(0) spawn { StatsWorker.new.handle(task.key, channel) } - - sleep 1 + Fiber.yield end end @@ -63,8 +62,7 @@ module ExtractStats while true key = channel.receive spawn { StatsWorker.new.handle(key, channel) } - - sleep 1 + Fiber.yield end end end -- 2.23.0
1416
Age (days ago)
1416
Last active (days ago)
0 comments
1 participants
participants (1)
-
Cao Xueliang