Skip to content

Commit 8a0ec0b

Browse files
committed
fix: html/process: don't aggressively poll IPC socket
Fixes the CPU hammering that it did beforehand. This isn't a perfect solution, but it works.
1 parent 3b2d226 commit 8a0ec0b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/parsers/html/process.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import std/[base64, options, json, logging, monotimes, net]
1+
import std/[base64, options, json, logging, monotimes, net, os]
22
import ./ipc
33
import ./document
44
import ../../web/dom
@@ -35,6 +35,7 @@ proc talk(
3535
discard nix.ioctl(client.socket.getFd().cint, nix.FIONREAD, addr(count))
3636

3737
if count < 1:
38+
sleep(250)
3839
return
3940

4041
let

0 commit comments

Comments
 (0)