mirror of
https://github.com/Sonarr/Sonarr
synced 2025-01-18 13:23:51 +00:00
Fixed: NzbDrone using 100% CPU on Linux.
This commit is contained in:
parent
4f85865b4a
commit
23c6cf2210
1 changed files with 3 additions and 3 deletions
|
@ -277,7 +277,7 @@ namespace Microsoft.AspNet.SignalR.Messaging
|
||||||
// if the client is very slow then this invoke call might not end quickly and this will make the CPU
|
// if the client is very slow then this invoke call might not end quickly and this will make the CPU
|
||||||
// hot waiting for the task to return.
|
// hot waiting for the task to return.
|
||||||
|
|
||||||
var spinWait = new SpinWait();
|
int disposeRetryCount = 0;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@ -287,7 +287,7 @@ namespace Microsoft.AspNet.SignalR.Messaging
|
||||||
SubscriptionState.Idle);
|
SubscriptionState.Idle);
|
||||||
|
|
||||||
// If we're not working then stop
|
// If we're not working then stop
|
||||||
if (state != SubscriptionState.InvokingCallback)
|
if (state != SubscriptionState.InvokingCallback || disposeRetryCount ++ > 10)
|
||||||
{
|
{
|
||||||
if (state != SubscriptionState.Disposed)
|
if (state != SubscriptionState.Disposed)
|
||||||
{
|
{
|
||||||
|
@ -305,7 +305,7 @@ namespace Microsoft.AspNet.SignalR.Messaging
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
spinWait.SpinOnce();
|
Thread.Sleep(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue