Skip to content

Instantly share code, notes, and snippets.

@hishaamn
Created March 4, 2024 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hishaamn/c2e7890ff3e6e77edbba145bc3c2cb2a to your computer and use it in GitHub Desktop.
Save hishaamn/c2e7890ff3e6e77edbba145bc3c2cb2a to your computer and use it in GitHub Desktop.
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