Skip to content

Commit

Permalink
fix failed jobs retrying
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Mar 28, 2019
1 parent 2a2c451 commit 7d28272
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion public/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/app.js": "/app.js?id=3fc0c0b5d14850a52685",
"/app.js": "/app.js?id=216ac977397857c5c8db",
"/app.css": "/app.css?id=cefed9132a927b70fdd6",
"/app-dark.css": "/app-dark.css?id=596688837e7ffbb58e37"
}
17 changes: 7 additions & 10 deletions resources/js/screens/failedJobs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
this.$http.get('/' + Horizon.path + '/api/jobs/failed?' + tagQuery + 'starting_at=' + starting)
.then(response => {
if(!this.$root.autoLoadsNewEntries && refreshing && !response.data.jobs.length){
if (!this.$root.autoLoadsNewEntries && refreshing && !response.data.jobs.length) {
return;
}
Expand Down Expand Up @@ -110,10 +110,10 @@
this.retryingJobs.push(id);
this.$http.post('/' + Horizon.path + '/api/jobs/retry/' + id)
.then(() => {
.then((response) => {
setTimeout(() => {
this.retryingJobs = _.reject(this.retryingJobs, job => job == id);
}, 3000);
}, 5000);
});
},
Expand All @@ -129,7 +129,7 @@
/**
* Determine if the given job has completed.
*/
hasCompleted(job){
hasCompleted(job) {
return _.find(job.retried_by, retry => retry.status == 'completed');
},
Expand All @@ -139,11 +139,7 @@
*/
refreshJobsPeriodically() {
this.interval = setInterval(() => {
if (this.page != 1) {
return;
}
this.loadJobs(0, true);
this.loadJobs((this.page - 1) * this.perPage, true);
}, 3000);
},
Expand Down Expand Up @@ -224,7 +220,8 @@
<span v-if="job.status != 'failed'" :title="job.name">{{jobBaseName(job.name)}}</span>
<router-link v-if="job.status === 'failed'" :title="job.name" :to="{ name: 'failed-jobs-preview', params: { jobId: job.id }}">
{{ jobBaseName(job.name) }}
</router-link><br>
</router-link>
<br>

<small class="text-muted">
Queue: {{job.queue}} | Tags: {{ job.payload.tags && job.payload.tags.length ? job.payload.tags.join(', ') : '' }}
Expand Down

0 comments on commit 7d28272

Please sign in to comment.