fix: 修复插件任务Worker启动依赖环

This commit is contained in:
sunlei 2026-06-18 08:45:57 +08:00
parent 10cabc5d6f
commit 500f5c69f1
2 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import * as path from 'path'; import * as path from 'path';
import { normalizeQqbotPluginTaskCron } from '../../application/task'; import { normalizeQqbotPluginTaskCron } from '../../application/task/qqbot-plugin-task-cron.validator';
import { import {
QQBOT_PLUGIN_ALLOWED_PERMISSIONS, QQBOT_PLUGIN_ALLOWED_PERMISSIONS,
QQBOT_PLUGIN_WORKER_TYPES, QQBOT_PLUGIN_WORKER_TYPES,

View File

@ -1,5 +1,7 @@
import { readFileSync } from 'node:fs'; import { readFileSync } from 'node:fs';
import { join } from 'node:path'; import { join } from 'node:path';
import { QqbotPluginPlatformService } from '../../../../src/modules/qqbot/plugin-platform/application/plugin-platform.service';
import { QqbotPluginTaskWorkerProcessor } from '../../../../src/modules/qqbot/plugin-platform/application/task/qqbot-plugin-task-worker.processor';
describe('QQBot plugin platform DI tokens', () => { describe('QQBot plugin platform DI tokens', () => {
it('does not inject the removed built-in plugin loader into platform services', () => { it('does not inject the removed built-in plugin loader into platform services', () => {
@ -17,4 +19,12 @@ describe('QQBot plugin platform DI tokens', () => {
expect(source).toContain('QqbotPluginPackageSourceService'); expect(source).toContain('QqbotPluginPackageSourceService');
expect(source).toContain('QqbotPluginWorkerRuntimeFactoryService'); expect(source).toContain('QqbotPluginWorkerRuntimeFactoryService');
}); });
it('keeps the task worker platform service dependency available at runtime', () => {
const paramTypes =
Reflect.getMetadata('design:paramtypes', QqbotPluginTaskWorkerProcessor) ||
[];
expect(paramTypes[1]).toBe(QqbotPluginPlatformService);
});
}); });