Skip to content

fix build page spamming api constantly when build is queued#301

Merged
tkyi merged 1 commit into
masterfrom
queuedBuildSpam
Jun 5, 2018
Merged

fix build page spamming api constantly when build is queued#301
tkyi merged 1 commit into
masterfrom
queuedBuildSpam

Conversation

@petey

@petey petey commented Jun 5, 2018

Copy link
Copy Markdown
Contributor

Context

When a build page is opened for a build that is still enqueued, the API will be spammed several times a second. This happens because the build-banner component calls reloadBuild() when it is either queued or running during the willRender event of the component lifecycle. When the build info is fetched, it causes the willRender event to fire again, and this loop can be extremely short. The current reload event only allows firing once per render loop, but this loop is very fast.

Objective

Hit the API only as often as BUILD_RELOAD_TIMER, by throttling all requests to the reload handler.

Misc

Fix tests broken in firefox due to nav-banner component writing a value after it has been destroyed.

@jithine jithine left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@@ -1,4 +1,4 @@
import { later, once } from '@ember/runloop';
import { later, throttle } from '@ember/runloop';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cool! 👍

@tkyi tkyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@tkyi tkyi merged commit c7fd2cb into master Jun 5, 2018
@tkyi tkyi deleted the queuedBuildSpam branch June 5, 2018 22:42
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