mirror of
https://github.com/docmost/docmost.git
synced 2026-08-27 16:57:05 +08:00
feat(ai): pre-warm the vector namespace
This commit is contained in:
@@ -15,7 +15,6 @@ export enum EventName {
|
||||
WORKSPACE_CREATED = 'workspace.created',
|
||||
WORKSPACE_UPDATED = 'workspace.updated',
|
||||
WORKSPACE_DELETED = 'workspace.deleted',
|
||||
USER_SESSION_STARTED = 'user.session.started',
|
||||
|
||||
BASE_CREATED = 'base.created',
|
||||
BASE_UPDATED = 'base.updated',
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
Post,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { UserService } from './user.service';
|
||||
import { UpdateUserDto } from './dto/update-user.dto';
|
||||
import { AuthUser } from '../../common/decorators/auth-user.decorator';
|
||||
@@ -14,7 +13,6 @@ import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
|
||||
import { AuthWorkspace } from '../../common/decorators/auth-workspace.decorator';
|
||||
import { User, Workspace } from '@docmost/db/types/entity.types';
|
||||
import { WorkspaceRepo } from '@docmost/db/repos/workspace/workspace.repo';
|
||||
import { EventName } from '../../common/events/event.contants';
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Controller('users')
|
||||
@@ -22,7 +20,6 @@ export class UserController {
|
||||
constructor(
|
||||
private readonly userService: UserService,
|
||||
private readonly workspaceRepo: WorkspaceRepo,
|
||||
private readonly eventEmitter: EventEmitter2,
|
||||
) {}
|
||||
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@@ -42,11 +39,6 @@ export class UserController {
|
||||
memberCount,
|
||||
};
|
||||
|
||||
this.eventEmitter.emit(EventName.USER_SESSION_STARTED, {
|
||||
userId: authUser.id,
|
||||
workspaceId: workspace.id,
|
||||
});
|
||||
|
||||
return { user: authUser, workspace: workspaceInfo };
|
||||
}
|
||||
|
||||
|
||||
+1
-1
Submodule apps/server/src/ee updated: 0d0ab522af...660418ac2c
@@ -49,6 +49,10 @@ export class StaticModule implements OnModuleInit {
|
||||
: undefined,
|
||||
POSTHOG_HOST: this.environmentService.getPostHogHost(),
|
||||
POSTHOG_KEY: this.environmentService.getPostHogKey(),
|
||||
AI_VECTOR_DRIVER:
|
||||
this.environmentService.getAiVectorDriver() === 'turbopuffer'
|
||||
? 'turbopuffer'
|
||||
: undefined,
|
||||
};
|
||||
|
||||
const windowScriptContent = `<script>window.CONFIG=${JSON.stringify(configString)};</script>`;
|
||||
|
||||
Reference in New Issue
Block a user