Skip to content

Commit

Permalink
feat(posts): create or update index in nextTick
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Aug 21, 2022
1 parent 89acf8c commit a76979f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/post/post.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ export class PostService {
process.nextTick(async () => {
// 异步更新缓存
await Promise.all([
this.imageService.recordImageMeta(this.model, res._id)
this.imageService.recordImageMeta(this.model, res._id),
this.createIndex(),
]);
});
return res;
Expand Down Expand Up @@ -230,7 +231,8 @@ export class PostService {

process.nextTick(async () => {
await Promise.all([
this.imageService.recordImageMeta(this.model, id)
this.imageService.recordImageMeta(this.model, id),
this.createIndex(),
]);
});

Expand Down

0 comments on commit a76979f

Please sign in to comment.