mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(api): resolve loading attachment onApplicationBootstrap logic from the CLI
This commit is contained in:
@@ -12,6 +12,7 @@ import { Module, OnApplicationBootstrap } from '@nestjs/common';
|
||||
import { MongooseModule } from '@nestjs/mongoose';
|
||||
import { PassportModule } from '@nestjs/passport';
|
||||
|
||||
import { AppInstance } from '@/app.instance';
|
||||
import { config } from '@/config';
|
||||
import { UserModule } from '@/user/user.module';
|
||||
|
||||
@@ -34,6 +35,9 @@ import { AttachmentService } from './services/attachment.service';
|
||||
})
|
||||
export class AttachmentModule implements OnApplicationBootstrap {
|
||||
onApplicationBootstrap() {
|
||||
if (!AppInstance.isReady()) {
|
||||
return;
|
||||
}
|
||||
// Ensure the directories exists
|
||||
if (!existsSync(config.parameters.uploadDir)) {
|
||||
mkdirSync(config.parameters.uploadDir, { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user