Skip to content

Commit

Permalink
perf(core): optimize room creation process
Browse files Browse the repository at this point in the history
- Move autoUpdate setting to after room creation
- Change initial value of autoUpdate to false in chat service
  • Loading branch information
dingyi222666 committed Nov 30, 2024
1 parent 5092cdb commit 9e5849b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions packages/core/src/middlewares/resolve_room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ export function apply(ctx: Context, config: Config, chain: ChatChain) {
]
)

cloneRoom.autoUpdate = true

logger.success(
session.text('chatluna.room.auto_create', [
session.userId,
Expand Down Expand Up @@ -212,8 +210,6 @@ export function apply(ctx: Context, config: Config, chain: ChatChain) {
]
)

cloneRoom.autoUpdate = true

logger.success(
session.text('chatluna.room.auto_create_template', [
session.userId,
Expand All @@ -222,6 +218,8 @@ export function apply(ctx: Context, config: Config, chain: ChatChain) {
)
}

cloneRoom.autoUpdate = true

await createConversationRoom(ctx, session, cloneRoom)

joinRoom = cloneRoom
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ export class ChatLunaService extends Service {
},
autoUpdate: {
type: 'boolean',
initial: true
initial: false
},
updatedTime: {
type: 'timestamp',
Expand Down

0 comments on commit 9e5849b

Please sign in to comment.