backend: use time constant in services/chart/index.ts
All checks were successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
All checks were successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
This commit is contained in:
parent
e814fdc7d1
commit
04d4dd323f
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
import { beforeShutdown } from '@/misc/before-shutdown.js';
|
||||
|
||||
import { MINUTE } from '@/const.js';
|
||||
import FederationChart from './charts/federation.js';
|
||||
import NotesChart from './charts/notes.js';
|
||||
import UsersChart from './charts/users.js';
|
||||
|
@ -41,11 +42,11 @@ const charts = [
|
|||
apRequestChart,
|
||||
];
|
||||
|
||||
// 20分おきにメモリ情報をDBに書き込み
|
||||
// Write memory information to DB every 20 minutes
|
||||
setInterval(() => {
|
||||
for (const chart of charts) {
|
||||
chart.save();
|
||||
}
|
||||
}, 1000 * 60 * 20);
|
||||
}, 20 * MINUTE);
|
||||
|
||||
beforeShutdown(() => Promise.all(charts.map(chart => chart.save())));
|
||||
|
|
Loading…
Reference in a new issue