Created
March 4, 2024 17:21
-
-
Save hishaamn/c2e7890ff3e6e77edbba145bc3c2cb2a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
protected override bool WaitForDedicatedServers(DispatchNewsletterArgs args) | |
{ | |
var flag1 = false; | |
var flag2 = true; | |
var retryCount = 3; | |
while (flag2) | |
{ | |
var num = this._dedicatedServersService.Status(args.Message, out var _); | |
if (num > 0 || retryCount <= 1) | |
{ | |
flag1 = true; | |
} | |
else | |
{ | |
--retryCount; | |
} | |
flag2 = args.DispatchInterruptRequest == DispatchInterruptSignal.None && (!flag1 || num > 0); | |
if (flag2) | |
{ | |
this._manualResetEvent.WaitOne(this._timeToWaitBetweenChecks); | |
} | |
} | |
return args.DispatchInterruptRequest == DispatchInterruptSignal.None; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment