-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 修复 server 包 Server.RegConsoleCommandEvent 函数在无终端环境下导致 CPU 飙升的问题
当 fmt.Scanln 无法从标准输入(stdin)读取内容时(例如,如果没有交互式终端附加到进程),它可能会立即返回一个错误。这将导致 for 循环以极快的速度不断执行,从而导致 CPU 使用率飙升。
- Loading branch information
1 parent
ac11e9e
commit 3e35e73
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters