From 7c746d287fbf0ebcb22d6e9d39cbdb7a51f77c87 Mon Sep 17 00:00:00 2001 From: pongo1231 Date: Wed, 7 Feb 2024 20:22:13 +0000 Subject: [PATCH] TwitchChatVotingProxy: Make busy loops more lenient Less resource heavy and fixes discord voting in wine --- TwitchChatVotingProxy/TwitchChatVotingProxy.cs | 2 +- TwitchChatVotingProxy/VotingReceiver/DiscordVotingReceiver.cs | 2 +- TwitchChatVotingProxy/VotingReceiver/TwitchVotingReceiver.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TwitchChatVotingProxy/TwitchChatVotingProxy.cs b/TwitchChatVotingProxy/TwitchChatVotingProxy.cs index d51e114b8..7177dc70f 100644 --- a/TwitchChatVotingProxy/TwitchChatVotingProxy.cs +++ b/TwitchChatVotingProxy/TwitchChatVotingProxy.cs @@ -109,7 +109,7 @@ private static async Task Main(string[] args) chaosPipe.SendMessageToPipe("hello"); while (!chaosPipe.GotHelloBack && chaosPipe.IsConnected()) { - await Task.Delay(0); + await Task.Delay(100); } if (chaosPipe.GotHelloBack) diff --git a/TwitchChatVotingProxy/VotingReceiver/DiscordVotingReceiver.cs b/TwitchChatVotingProxy/VotingReceiver/DiscordVotingReceiver.cs index 589fc257b..2db80b3e2 100644 --- a/TwitchChatVotingProxy/VotingReceiver/DiscordVotingReceiver.cs +++ b/TwitchChatVotingProxy/VotingReceiver/DiscordVotingReceiver.cs @@ -61,7 +61,7 @@ public async Task Init() while (!m_IsReady) { - await Task.Delay(0); + await Task.Delay(100); } return true; diff --git a/TwitchChatVotingProxy/VotingReceiver/TwitchVotingReceiver.cs b/TwitchChatVotingProxy/VotingReceiver/TwitchVotingReceiver.cs index aabbbc7c2..c827319ef 100644 --- a/TwitchChatVotingProxy/VotingReceiver/TwitchVotingReceiver.cs +++ b/TwitchChatVotingProxy/VotingReceiver/TwitchVotingReceiver.cs @@ -81,7 +81,7 @@ public async Task Init() while (!m_IsReady) { - await Task.Delay(0); + await Task.Delay(100); } return true;