Always preload the alloc node so the client can be dialed first

This commit is contained in:
Michael Lange
2019-08-07 17:35:15 -07:00
parent 186a620ef1
commit 038fc27ef0
2 changed files with 17 additions and 11 deletions

View File

@@ -100,15 +100,13 @@ export default Component.extend({
const timing = this.useServer ? this.serverTimeout : this.clientTimeout;
const logFetch = url =>
RSVP.race([this.token.authorizedRequest(url), timeout(timing)]).then(
response => response,
error => {
if (this.useServer) {
this.set('noConnection', true);
} else {
this.send('failoverToServer');
response => {
if (!response || !response.ok) {
this.nextErrorState(response);
}
throw error;
}
return response;
},
error => this.nextErrorState(error)
);
return Log.create({
@@ -119,6 +117,15 @@ export default Component.extend({
});
}),
nextErrorState(error) {
if (this.useServer) {
this.set('noConnection', true);
} else {
this.send('failoverToServer');
}
throw error;
},
actions: {
toggleStream() {
this.set('mode', 'streaming');

View File

@@ -9,9 +9,8 @@ export default Route.extend({
const pathWithTaskName = `${task.name}${decodedPath.startsWith('/') ? '' : '/'}${decodedPath}`;
return task
.stat(pathWithTaskName)
.then(statJson => {
return RSVP.all([task.stat(pathWithTaskName), task.get('allocation.node')])
.then(([statJson]) => {
if (statJson.IsDir) {
return RSVP.hash({
path: decodedPath,