From 26a5e6fe893b88b7d2f9c593fa9651c61fef54a5 Mon Sep 17 00:00:00 2001 From: Ly Tuan Kiet Date: Wed, 8 Jan 2025 18:08:52 +0700 Subject: [PATCH] chore: update Node version and enhance package scripts - Updated Node version in .nvmrc from 24.0.0-nightly to 23.5.0 for better compatibility. - Modified package.json to include a prestart script for Prisma generation and adjusted the start script to enable watch mode. - Removed unused import from document.schema.ts to clean up the code. - Added keepAlive setting for subscriptions in graphql.module.ts to improve connection stability. These changes aim to streamline the development environment and enhance the application's performance and maintainability. --- .nvmrc | 2 +- package.json | 4 ++-- src/Document/document.schema.ts | 1 - src/Graphql/graphql.module.ts | 5 ++--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.nvmrc b/.nvmrc index 7b8e176..dd6db9f 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -24.0.0-nightly202412106c03beba46 \ No newline at end of file +23.5.0 \ No newline at end of file diff --git a/package.json b/package.json index 8b5e830..66e15ab 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "private": true, "license": "UNLICENSED", "scripts": { + "prestart": "npm run prisma:generate", + "start": "nest start --watch", "build": "nest build", - "start": "nest start", - "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", "start:prod": "node dist/main", "prisma:generate": "npx prisma generate --schema=./epess-database/prisma/schema.prisma", diff --git a/src/Document/document.schema.ts b/src/Document/document.schema.ts index 552b5a2..21834e1 100644 --- a/src/Document/document.schema.ts +++ b/src/Document/document.schema.ts @@ -6,7 +6,6 @@ import { PothosSchema, SchemaBuilderToken, } from "@smatch-corp/nestjs-pothos"; -import Delta from "quill-delta"; import { MinioService } from "src/Minio/minio.service"; import { PromptType } from "src/OpenAI/openai.service"; import { RedisService } from "src/Redis/redis.service"; diff --git a/src/Graphql/graphql.module.ts b/src/Graphql/graphql.module.ts index 4690ddc..f06dd7d 100644 --- a/src/Graphql/graphql.module.ts +++ b/src/Graphql/graphql.module.ts @@ -114,10 +114,9 @@ import { GraphqlService } from "./graphql.service"; plugins: [ApolloServerPluginLandingPageLocalDefault()], installSubscriptionHandlers: true, subscriptions: { + keepAlive: 10000, "graphql-ws": { - onSubscribe(ctx, message) { - console.log("onSubscribe", ctx, message); - }, + connectionInitWaitTimeout: 10000, onConnect: (ctx: Context>) => { if (!ctx.connectionParams) { Logger.log("No connectionParams provided", "GraphqlModule");