Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 404 error #17

Merged
6 commits merged into from May 8, 2018
Merged

Fix 404 error #17

6 commits merged into from May 8, 2018

Conversation

can-dan-rigbey
Copy link
Contributor

Change to how checking the installation status works after starting an installation. Currently, on large installations, it can attempt to get the status before the web api has been fully created.

  • Add a timeout command line parameter to set the maximum amount of time that the client should ignore 404 errors returned by the api.
  • Use this to ignore 404 timeouts when using Api.GetSession(). If the time limit is reached, then abort from the process. If it successfully manages to connect with the api before that time, then carry on as usual

@ghost ghost requested review from a user March 16, 2018 14:01
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to be a good, more robust solution to the problem. I've flagged a couple of minor changes to make.

TimeSpan interval = new TimeSpan(0, 0, 0, 2);
Dictionary<string, dynamic> response;
var successfullyReachedApi = false;
DateTime apiNotFoundAbortTime = DateTime.Now.AddSeconds(Options.InstallationStatusTimeout?? 60);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please improve the whitespace formatting around the null conditional operator.

// The api should not be returning a 404 status at this point
if (!success)
{
throw new Exception("Remote API returned status 404");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can we throw something more specific than System.Exception. It's bad practise to throw these. I think System.Web.HttpException would be more appropriate instead.

@ghost ghost merged commit 20a778d into DNNCommunity:development May 8, 2018
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant