Skip to content

Commit 0793ab0

Browse files
committed
Merge pull request Redth#274 from JasonGit/master
Resolve issue 244: After the PushSharp lib (v2.1.2) is idle for 5 mins, ...
2 parents 6b95dc0 + 675580a commit 0793ab0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

PushSharp.Core/PushServiceBase.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ private void CheckScale(object state = null)
289289
Log.Info("{0} -> Destroying Channel", this);
290290
ScaleChannels(ChannelScaleAction.Destroy);
291291
}
292-
while (channels.Count < ServiceSettings.Channels && !this.cancelTokenSource.IsCancellationRequested)
292+
while (channels.Count < ServiceSettings.Channels && !this.cancelTokenSource.IsCancellationRequested
293+
&& (DateTime.UtcNow - lastNotificationQueueTime) <= ServiceSettings.IdleTimeout
294+
&& Interlocked.Read(ref trackedNotificationCount) > 0)
293295
{
294296
Log.Info("{0} -> Creating Channel", this);
295297
ScaleChannels(ChannelScaleAction.Create);

0 commit comments

Comments
 (0)