From 1a61f2cee9937ded577bf80b8e2803381d0d12c7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 8 Mar 2019 13:10:38 +0900 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8B=95=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/admin/views/queue.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/client/app/admin/views/queue.vue b/src/client/app/admin/views/queue.vue index ae3aa0db57..e37408d70d 100644 --- a/src/client/app/admin/views/queue.vue +++ b/src/client/app/admin/views/queue.vue @@ -51,8 +51,18 @@ export default Vue.extend({ }, created() { - this.$root.api('admin/queue/stats').then(stats => { - this.stats = stats; + const fetchStats = () => { + this.$root.api('admin/queue/stats', {}, true).then(stats => { + this.stats = stats; + }); + }; + + fetchStats(); + + const clock = setInterval(fetchStats, 1000); + + this.$once('hook:beforeDestroy', () => { + clearInterval(clock); }); },