Swapped onApplicationStart() for applicationStop() where possible and… #403
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… added onRequestEnd() to run the applicationStop() function. also removed what seemed like some duplicate logic for when to display the dashboard, but i'm not sure if it was really duplicate. everything seems to work fine without it though. I also made it so that if the version changes that causes the application to reset.
the reason for the change is that calling onApplicationStart() doesn't actually reset the application. it just resets the variables. while you would think this would be sufficient, in my experience you often have to change the application name itself in order to get the freshest version of your api to be reflected in the dashboard and requests.
this does mean you don't get the freshest version of the api on that first request for the new version, but you are 100% going to get it on the next request.