From 9387693f1c1748a7855bcf9593a75531337496cb Mon Sep 17 00:00:00 2001 From: LF112 Date: Mon, 23 Sep 2024 23:35:46 +0800 Subject: [PATCH] refactor: fix --- src/modules/assets/assets.marketplace.service.ts | 7 +++---- src/modules/bootstrap/bootstrap.service.ts | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/assets/assets.marketplace.service.ts b/src/modules/assets/assets.marketplace.service.ts index 08695173..96c0b7a4 100644 --- a/src/modules/assets/assets.marketplace.service.ts +++ b/src/modules/assets/assets.marketplace.service.ts @@ -18,7 +18,7 @@ export class AssetsMarketplaceService { private readonly assetsCommonRepository: AssetsCommonRepository, ) {} - public async initWorfklowMarketplace() { + public async initWorkflowMarketplace() { // Init workflow marketplace const data = BUILT_IN_WORKFLOW_MARKETPLACE_LIST; const allTags = data.map((x) => x.tags || []).flat(); @@ -34,14 +34,13 @@ export class AssetsMarketplaceService { } public async initBuiltInLLMMarketplace() { - const data = ONEAPI_CHANNELS; - for (const item of data) { + for (const item of ONEAPI_CHANNELS) { await this.llmChannelAssetRepository.initBuiltInMarketPlace('llm-channel', item); } } public async initBuiltInMarketplace() { - await this.initWorfklowMarketplace(); + await this.initWorkflowMarketplace(); if (config.oneapi.enabled) { await this.initBuiltInLLMMarketplace(); } diff --git a/src/modules/bootstrap/bootstrap.service.ts b/src/modules/bootstrap/bootstrap.service.ts index 08a7f4b5..773292d7 100644 --- a/src/modules/bootstrap/bootstrap.service.ts +++ b/src/modules/bootstrap/bootstrap.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@nestjs/common'; -import { SystemConfigurationRepository } from '../../database/repositories/system-configuration.repository'; +import { SystemConfigurationRepository } from '@/database/repositories/system-configuration.repository'; import { AssetsMarketplaceService } from '../assets/assets.marketplace.service'; import { ToolsRegistryService } from '../tools/tools.registry.service'; @@ -13,7 +13,7 @@ export class BootstrapService { public async bootstrap() { // Register built in tools - this.toolsRegistryService.initBuiltInTools(); + await this.toolsRegistryService.initBuiltInTools(); await this.systemConfigurationRepository.initAesKey(); await this.systemConfigurationRepository.initOneApiRootUserToken(); await this.marketplaceService.initBuiltInMarketplace();