summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/ReactionService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/core/ReactionService.ts')
-rw-r--r--packages/backend/src/core/ReactionService.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts
index 86213e4576..e7bbd44926 100644
--- a/packages/backend/src/core/ReactionService.ts
+++ b/packages/backend/src/core/ReactionService.ts
@@ -192,8 +192,12 @@ export class ReactionService {
.where('id = :id', { id: note.id })
.execute();
- // 30%の確率でハイライト用ランキング更新
- if (Math.random() < 0.3 && note.userId !== user.id) {
+ // 30%の確率、セルフではない、3日以内に投稿されたノートの場合ハイライト用ランキング更新
+ if (
+ Math.random() < 0.3 &&
+ note.userId !== user.id &&
+ (Date.now() - this.idService.parse(note.id).date.getTime()) < 1000 * 60 * 60 * 24 * 3
+ ) {
if (note.channelId != null) {
if (note.replyId == null) {
this.featuredService.updateInChannelNotesRanking(note.channelId, note.id, 1);