Skip to content

Commit d4fcc69

Browse files
committed
enhance(backend): remove redis-info dep
1 parent 389861f commit d4fcc69

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

packages/backend/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"@swc/cli": "0.7.9",
9797
"@swc/core": "1.15.7",
9898
"@twemoji/parser": "16.0.0",
99-
"@types/redis-info": "3.0.3",
10099
"accepts": "1.3.8",
101100
"ajv": "8.17.1",
102101
"archiver": "7.0.1",
@@ -154,7 +153,6 @@
154153
"random-seed": "0.3.0",
155154
"ratelimiter": "3.4.1",
156155
"re2": "1.23.0",
157-
"redis-info": "3.1.0",
158156
"reflect-metadata": "0.2.2",
159157
"rename": "1.0.4",
160158
"rss-parser": "3.13.0",

packages/backend/src/core/QueueService.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { randomUUID } from 'node:crypto';
77
import { Inject, Injectable } from '@nestjs/common';
88
import { MetricsTime, type JobType } from 'bullmq';
9-
import { parse as parseRedisInfo } from 'redis-info';
109
import type { IActivity } from '@/core/activitypub/type.js';
1110
import type { MiDriveFile } from '@/models/DriveFile.js';
1211
import type { MiWebhook, WebhookEventTypes } from '@/models/Webhook.js';
@@ -86,6 +85,19 @@ const REPEATABLE_SYSTEM_JOB_DEF = [{
8685
pattern: '0 4 * * *',
8786
}];
8887

88+
function parseRedisInfo(infoText: string): Record<string, string> {
89+
const fields = infoText
90+
.split('\n')
91+
.filter(line => line.length > 0 && !line.startsWith('#'))
92+
.map(line => line.trim().split(':'));
93+
94+
const result: Record<string, string> = {};
95+
for (const [key, value] of fields) {
96+
result[key] = value;
97+
}
98+
return result;
99+
}
100+
89101
@Injectable()
90102
export class QueueService {
91103
constructor(

pnpm-lock.yaml

Lines changed: 6 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)