Skip to content

Commit 78bf0e3

Browse files
skiminkiAloril
authored andcommitted
Fix a bug in remote runner causing it to burn CPU
1 parent a273680 commit 78bf0e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cuteseal-remote-runner/main.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ namespace {
212212
pollDeadlineMs = -1;
213213
} else {
214214
// active DL
215-
int64_t nsLeft = getClockNs() - bestmoveDeadlineNs;
215+
int64_t nsLeft = bestmoveDeadlineNs - getClockNs();
216216
if (nsLeft < 0) {
217217
pollDeadlineMs = 0; // one more try, but no wait
218218
} else {
@@ -242,7 +242,7 @@ namespace {
242242
}
243243
}
244244

245-
// we'll also send this to the engine
245+
// we'll also send the line to the engine
246246
fputs(line, toChild);
247247
fputc('\n', toChild);
248248
fflush(toChild);

0 commit comments

Comments
 (0)