wuyi 3 лет назад
Родитель
Сommit
7b4045da58
1 измененных файлов с 8 добавлено и 5 удалено
  1. 8 5
      src/moments/moments.service.ts

+ 8 - 5
src/moments/moments.service.ts

@@ -47,6 +47,7 @@ export class MomentsService {
                     this.delay()
                 }, 3 * 60 * 1000)
             }, 24 * 60 * 60 * 1000)
+            //24 * 60
         }, delayTime)
     }
 
@@ -146,11 +147,13 @@ export class MomentsService {
 
         chatRoleList.forEach(async role => {
             const text = await this.chatService.sendMessage(null, role.condition)
-            const momentsDto = new MomentsDto
-            momentsDto.content = text
-            momentsDto.userId = role.id
-            momentsDto.isPush = false
-            await this.momentsRepository.save(momentsDto)
+            if (text.trim() !== '') {
+                const momentsDto = new MomentsDto
+                momentsDto.content = text
+                momentsDto.userId = role.id
+                momentsDto.isPush = false
+                await this.momentsRepository.save(momentsDto)
+            }
         })
     }