Skip to content

Commit 67c808c

Browse files
committed
update: spam detection threshold in PostService
1 parent d5174d3 commit 67c808c

File tree

1 file changed

+3
-3
lines changed
  • packages/velog-cron/src/services/PostService

1 file changed

+3
-3
lines changed

packages/velog-cron/src/services/PostService/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export class PostService implements Service {
273273
}
274274

275275
const notAlphanumbericKorean = replaced.replace(/[a-zA-Z-0-9]/g, '') // remove korean
276-
if (notAlphanumbericKorean.length / replaced.length > 0.35) {
276+
if (notAlphanumbericKorean.length / replaced.length > 0.2) {
277277
score++
278278
}
279279

@@ -295,10 +295,10 @@ export class PostService implements Service {
295295
}
296296
}
297297

298-
if (score >= 3) {
298+
if (score >= 4) {
299299
return {
300300
isSpam: true,
301-
reason: `initScore: ${initScore}, foreign, ${'bannedAltKeywords: '.concat(
301+
reason: `initScore: ${initScore}, ${'bannedAltKeywords: '.concat(
302302
usedBannedAltKeywords.join(','),
303303
)}`,
304304
}

0 commit comments

Comments
 (0)