mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
Always preload the alloc node so the client can be dialed first
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user