summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors/system
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/queue/processors/system')
-rw-r--r--packages/backend/src/queue/processors/system/index.ts2
-rw-r--r--packages/backend/src/queue/processors/system/tick-charts.ts28
2 files changed, 30 insertions, 0 deletions
diff --git a/packages/backend/src/queue/processors/system/index.ts b/packages/backend/src/queue/processors/system/index.ts
index 636fefc402..1513ea4a84 100644
--- a/packages/backend/src/queue/processors/system/index.ts
+++ b/packages/backend/src/queue/processors/system/index.ts
@@ -1,8 +1,10 @@
import * as Bull from 'bull';
+import { tickCharts } from './tick-charts';
import { resyncCharts } from './resync-charts';
import { cleanCharts } from './clean-charts';
const jobs = {
+ tickCharts,
resyncCharts,
cleanCharts,
} as Record<string, Bull.ProcessCallbackFunction<Record<string, unknown>> | Bull.ProcessPromiseFunction<Record<string, unknown>>>;
diff --git a/packages/backend/src/queue/processors/system/tick-charts.ts b/packages/backend/src/queue/processors/system/tick-charts.ts
new file mode 100644
index 0000000000..d53089f89c
--- /dev/null
+++ b/packages/backend/src/queue/processors/system/tick-charts.ts
@@ -0,0 +1,28 @@
+import * as Bull from 'bull';
+
+import { queueLogger } from '../../logger';
+import { activeUsersChart, driveChart, federationChart, hashtagChart, instanceChart, notesChart, perUserDriveChart, perUserFollowingChart, perUserNotesChart, perUserReactionsChart, usersChart, apRequestChart } from '@/services/chart/index';
+
+const logger = queueLogger.createSubLogger('tick-charts');
+
+export async function tickCharts(job: Bull.Job<Record<string, unknown>>, done: any): Promise<void> {
+ logger.info(`Tick charts...`);
+
+ await Promise.all([
+ federationChart.tick(false),
+ notesChart.tick(false),
+ usersChart.tick(false),
+ activeUsersChart.tick(false),
+ instanceChart.tick(false),
+ perUserNotesChart.tick(false),
+ driveChart.tick(false),
+ perUserReactionsChart.tick(false),
+ hashtagChart.tick(false),
+ perUserFollowingChart.tick(false),
+ perUserDriveChart.tick(false),
+ apRequestChart.tick(false),
+ ]);
+
+ logger.succ(`All charts successfully ticked.`);
+ done();
+}