From 04d2415eb8ce6a99bd454291c717d4025fe024ea Mon Sep 17 00:00:00 2001 From: mei23 Date: Fri, 4 Jun 2021 14:47:49 +0900 Subject: [PATCH] Revert "Test shutdown" This reverts commit 85182e7dd196cdd9ecb46cfb50adaabd04c5ba60. --- src/services/chart/index.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/services/chart/index.ts b/src/services/chart/index.ts index f1d22e0d7e..61eb431ea3 100644 --- a/src/services/chart/index.ts +++ b/src/services/chart/index.ts @@ -40,13 +40,11 @@ const charts = [ perUserDriveChart, ]; -if (process.env.NODE_ENV !== 'test') { - // 20分おきにメモリ情報をDBに書き込み - setInterval(() => { - for (const chart of charts) { - chart.save(); - } - }, 1000 * 60 * 20); +// 20分おきにメモリ情報をDBに書き込み +setInterval(() => { + for (const chart of charts) { + chart.save(); + } +}, 1000 * 60 * 20); - beforeShutdown(() => Promise.all(charts.map(chart => chart.save()))); -} +beforeShutdown(() => Promise.all(charts.map(chart => chart.save())));