Skip to content

Commit 26a9371

Browse files
committed
update: PostLikeService to use async/await for searchSync update
1 parent 8246da6 commit 26a9371

File tree

1 file changed

+4
-4
lines changed
  • packages/velog-server/src/services/PostLikeService

1 file changed

+4
-4
lines changed

packages/velog-server/src/services/PostLikeService/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ export class PostLikeService implements Service {
120120
await this.postService.updatePostScore(postId)
121121
}
122122

123-
setTimeout(() => {
123+
setTimeout(async () => {
124124
try {
125-
this.searchService.searchSync.update(post.id)
125+
await this.searchService.searchSync.update(post.id)
126126
} catch (error) {
127127
console.log('likePost searchSync update error', error)
128128
}
@@ -190,9 +190,9 @@ export class PostLikeService implements Service {
190190
})
191191

192192
await this.postService.updatePostScore(postId)
193-
setTimeout(() => {
193+
setTimeout(async () => {
194194
try {
195-
this.searchService.searchSync.update(post.id)
195+
await this.searchService.searchSync.update(post.id)
196196
} catch (error) {
197197
console.log('unlikePost searchSync update error', error)
198198
}

0 commit comments

Comments
 (0)