From a212d1e25460564e4cb4d04a81c62b1d409511f8 Mon Sep 17 00:00:00 2001 From: Allen Short Date: Thu, 16 Feb 2017 08:44:18 -0600 Subject: [PATCH] Retry fetching query result on failure (fixes #36) --- client/app/services/query-result.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/app/services/query-result.js b/client/app/services/query-result.js index 1533b2b948..c15734c4d4 100644 --- a/client/app/services/query-result.js +++ b/client/app/services/query-result.js @@ -496,8 +496,16 @@ function QueryResultService($resource, $timeout, $q, QueryResultError) { } }, (error) => { logger('Connection error', error); - // TODO: use QueryResultError, or better yet: exception/reject of promise. - this.update({ job: { error: 'failed communicating with server. Please check your Internet connection and try again.', status: 4 } }); + this.update({ + job: { + error: 'Failed communicating with server. Retrying...', + status: 4, + id: this.job.id, + }, + }); + $timeout(() => { + this.refreshStatus(query); + }, 3000); }); }