Skip to content

Commit

Permalink
fix: add retry logical
Browse files Browse the repository at this point in the history
  • Loading branch information
abandon888 committed Mar 18, 2024
1 parent 5729387 commit bc817bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ export class UserService {
//验证短信验证码
async verifyCode(registerMsg: registerInfo): Promise<CreateUserDto> {
//将registerMsg.SMSCode和数据库中的验证码进行比对
// if (registerMsg.SMSCode !== this.smsCode[registerMsg.phone]) {
// throw new BadRequestException('验证码错误');
// }
if (registerMsg.SMSCode !== this.smsCode[registerMsg.phone]) {
throw new BadRequestException('验证码错误');
}
//如果一致,将registerInfo类型转化为CreateUserDto类型
let createUserDto = new CreateUserDto();
createUserDto = registerMsg;
Expand Down Expand Up @@ -150,7 +150,7 @@ export class UserRegisteredAskAiHandler {
@OnEvent('user.registered')
handleUserRegisteredEvent(event: UserRegisteredAskAiEvent) {
console.log('用户注册后AI分析开始', event.userInfo);
this.handleEventWithRetry(event, 1);
this.handleEventWithRetry(event, 3);
}

async getAIResponse(userInfo: string, prompt = stagePrompt): Promise<string> {
Expand Down

0 comments on commit bc817bf

Please sign in to comment.