Merge pull request #8281 from hashicorp/b-ui/fix-log-streaming

UI: Revert AbortController polyfill to use native AbortController on logs page
This commit is contained in:
Michael Lange 2020-06-25 09:26:49 -07:00 committed by GitHub
commit ff015d2997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -4,10 +4,15 @@ import { action, computed } from '@ember/object';
import RSVP from 'rsvp';
import { logger } from 'nomad-ui/utils/classes/log';
import timeout from 'nomad-ui/utils/timeout';
import { AbortController } from 'fetch';
import { classNames } from '@ember-decorators/component';
import classic from 'ember-classic-decorator';
class MockAbortController {
abort() {
/* noop */
}
}
@classic
@classNames('boxed-section', 'task-log')
export default class TaskLog extends Component {
@ -51,7 +56,7 @@ export default class TaskLog extends Component {
// If the log request can't settle in one second, the client
// must be unavailable and the server should be used instead
const aborter = new AbortController();
const aborter = window.AbortController ? new AbortController() : new MockAbortController();
const timing = this.useServer ? this.serverTimeout : this.clientTimeout;
// Capture the state of useServer at logger create time to avoid a race