pnpframework icon indicating copy to clipboard operation
pnpframework copied to clipboard

Sometimes the request to get channels from a new created Teams is not finishing

Open roberAlb opened this issue 2 years ago • 0 comments

Basically for new installations where we are provisioning a Team with a channel, in this piece of code there is a line to get channels from method InitTeamDrive

try { channels = HttpHelper.MakeGetRequestForString($"{GraphHelper.MicrosoftGraphBaseURI}v1.0/teams/{teamId}/channels", accessToken); if (!string.IsNullOrEmpty(channels)) { wait = false; } } catch (Exception) { Thread.Sleep(TimeSpan.FromSeconds(5)); }

if (iterations > 60) { throw new Exception($"Could not get channels for team with id {teamId} within timeout."); }

The line in bold sometimes is not finishing and returning the exception which is bold as well. Not happening always. Do you think that the delay applied is enough? If the exception is triggered it means that it was trying during 5 mins, which I think is quite enough.

roberAlb avatar Dec 20 '23 12:12 roberAlb