Open
Description
What version of PushSharp are you using?
4.0.4
Describe your issue:
I have WNS broker running in process in the cloud. The broker is instantiated only once when the azure role starts and it runs uninterrupted for days. When a WNS authentication token expires, WnsAccessTokenManager will try to updated it only once.
Look at the code:
` Task renewAccessTokenTask = null;
string accessToken = null;
HttpClient http;
public WnsAccessTokenManager (WnsConfiguration configuration)
{
http = new HttpClient ();
Configuration = configuration;
}
public WnsConfiguration Configuration { get; private set; }
public async Task<string> GetAccessToken ()
{
if (accessToken == null) {
if (renewAccessTokenTask == null) {
Log.Info ("Renewing Access Token");
renewAccessTokenTask = RenewAccessToken ();
await renewAccessTokenTask;
} else {
Log.Info ("Waiting for access token");
await renewAccessTokenTask;
}
}
return accessToken;
}`
"renewAccessTokenTask " will be null only for the first time.
Metadata
Metadata
Assignees
Labels
No labels