Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MahdiKarimipour/086ad925cd4c42b6201db9e459052087 to your computer and use it in GitHub Desktop.
Save MahdiKarimipour/086ad925cd4c42b6201db9e459052087 to your computer and use it in GitHub Desktop.
Pellerex Foundation, Azure DevOps, Keep Fetching Project List
int retries = 0;
while (true)
{
if (retries > 10)
{
return (null, EngineeringOpsConstants.ErrorCodes.GenericError);
}
Thread.Sleep(2000);
projectList = await GetProjects(project.Organisation);
var createdProject = projectList.FirstOrDefault(p => p.Name == project.Name);
if (createdProject.IsEmpty())
{
retries++;
continue;
}
return (createdProject, string.Empty);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment