Test shutdown

This commit is contained in:
mei23 2021-06-04 14:37:45 +09:00
parent a5a2f9d01e
commit 85182e7dd1
No known key found for this signature in database
GPG Key ID: DD8628500D3E4B23
1 changed files with 9 additions and 7 deletions

View File

@ -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())));
}