Skip to content

Commit 01f8562

Browse files
committed
fix: add block list logic
1 parent 7b03a2c commit 01f8562

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/velog-scripts/scripts/privatePostsOfSpamAccount.mts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class Runner implements IRunner {
2626
const user = await this.findUsersByUsername(username)
2727
const posts = await this.findWritenPostsByUserId(user.id)
2828

29+
// add block list
30+
await this.redis.addBlockList(username)
31+
2932
if (posts.length === 0) {
3033
console.log(`${user.username} 유저의 비공개 처리 할 게시글이 없습니다.`)
3134
continue
@@ -44,9 +47,6 @@ class Runner implements IRunner {
4447
// set private = true
4548
await this.setIsPrivatePost(postIds)
4649

47-
// add block list
48-
await this.redis.addBlockList(username)
49-
5050
const blockUesrInfo: BlockUserInfo = {
5151
id: user.id,
5252
username: user.username,
@@ -62,7 +62,7 @@ class Runner implements IRunner {
6262
}
6363

6464
if (handledUser.length === 0) {
65-
console.log('게시글 비공개 처리된 유저가 존재하지 않습니다.')
65+
console.log('비공개 게시글 처리된 유저가 존재하지 않습니다.')
6666
process.exit(0)
6767
}
6868

0 commit comments

Comments
 (0)