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

Prevent multiple simultaneous calls to the servers endpoint #500

Merged
merged 1 commit into from
Jul 8, 2019

Conversation

lorenzo-cavazzi
Copy link
Member

Avoid overlapping queries to the /servers endpoint by implementing a very basic semaphore logic.

The first commit comes from #498, merge after that.

@lorenzo-cavazzi
Copy link
Member Author

Rebased and ready to test. Preview available here: https://lorenzotest.dev.renku.ch

To test it, go to any page where notebooks are visualized (e.g. https://lorenzotest.dev.renku.ch/notebooks), open the network tab and try to slow down the connection so that a single response from the /servers API will take more than 3 seconds to come (e.g. from the chrome debugger, select a custom device with network throttling very bad).

It's actually easier to test by setting the POLLING_INTERVAL variable down to a very low value (e.g. 300 instead of 3000), but this requires to checkout the branch locally and running it through telepresence.

Copy link
Contributor

@vfried vfried left a comment

Choose a reason for hiding this comment

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

I tested and it works well, the code looks good also.

Well done!

@lorenzo-cavazzi lorenzo-cavazzi merged commit 02b3afa into master Jul 8, 2019
@lorenzo-cavazzi lorenzo-cavazzi deleted the 000-antispam-semaphore branch July 8, 2019 19:57
@ciyer ciyer added this to the 0.6.0 milestone Jul 19, 2019
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.

3 participants