Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Conversation

@ethanaobrien
Copy link

This should fix #1010 which is a critical(ly annoying) enough bug that I downloaded Xcode to figure this out.
I have no idea if this has any unintended issues, because I do not know the codebase or swift. Feel free to close this PR if it has unintended issues

extension FileHandle {
func nextLine() -> String? {
while availableData.isEmpty {
Thread.sleep(forTimeInterval: 0.2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is really a solution. This is still going to block the entire thread responsible for handling logs and can arguably lead to more downtime then spin-waiting

Copy link
Author

@ethanaobrien ethanaobrien Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an alternative approach that can be taken? At the moment this issue causes a 100% utilized thread per opened application, so when I open 3 apps from the whisky menu I have a 300% CPU usage by whisky and get a ridiculous power draw for nothing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Whisky app takes 100% CPU the entire time it's running

2 participants