BigW Consortium Gitlab
Stop DDOSing ourselves ## What does this MR do? Adds `hiddenInterval` to `SmartInterval` settings. This will be the interval used whilst the tab is inactive. If this setting is not set it will `cancel` as it would have done before. Adds `immediateExecution` to `SmartInterval` settings. This boolean will dictate whether to execute the callback once before the first interval or not. Uses `SmartInterval` with the new `hiddenInterval` settings to slow the polling for the MR widget on inactive tabs. Fixes issue where `SmartInterval`s `visibilitychange` listeners are not getting called because jQuery doesn't support them. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? We're ddosing ourselves on the MR page. ## Screenshots (if relevant) ![Screen_Shot_2016-11-25_at_18.36.25](/uploads/c4457c55872f592e921a50cf5462022e/Screen_Shot_2016-11-25_at_18.36.25.png) ~30 seconds difference between the first 2 requests _(a couple requests had fired already so it's backed off already)_. _-changed to different tab-_ ~2 minutes difference between the middle 2 requests. _-changed tab back to MR-_ ~10 seconds difference between the last 2 requests. ## Does this MR meet the acceptance criteria? - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #24807 See merge request !7762
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
bin | Loading commit data... | |
config | Loading commit data... | |
controllers | Loading commit data... | |
factories | Loading commit data... | |
features | Loading commit data... | |
finders | Loading commit data... | |
fixtures | Loading commit data... | |
helpers | Loading commit data... | |
initializers | Loading commit data... | |
javascripts | Loading commit data... | |
lib | Loading commit data... | |
mailers | Loading commit data... | |
migrations | Loading commit data... | |
models | Loading commit data... | |
policies | Loading commit data... | |
requests | Loading commit data... | |
routing | Loading commit data... | |
serializers | Loading commit data... | |
services | Loading commit data... | |
support | Loading commit data... | |
tasks/gitlab | Loading commit data... | |
uploaders | Loading commit data... | |
views | Loading commit data... | |
workers | Loading commit data... | |
factories_spec.rb | Loading commit data... | |
rails_helper.rb | Loading commit data... | |
rake_helper.rb | Loading commit data... | |
simplecov_env.rb | Loading commit data... | |
spec_helper.rb | Loading commit data... | |
teaspoon_env.rb | Loading commit data... |