diff --git a/src/services/chart/index.ts b/src/services/chart/index.ts index 61eb431ea3..f1d22e0d7e 100644 --- a/src/services/chart/index.ts +++ b/src/services/chart/index.ts @@ -40,11 +40,13 @@ const charts = [ perUserDriveChart, ]; -// 20分おきにメモリ情報をDBに書き込み -setInterval(() => { - for (const chart of charts) { - chart.save(); - } -}, 1000 * 60 * 20); +if (process.env.NODE_ENV !== 'test') { + // 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()))); +}