enhance(backend): 3日以内に投稿されたノートのみハイライト用スコア加算

This commit is contained in:
syuilo 2023-10-07 07:59:46 +09:00
parent 4a595153dc
commit 3a7558f36c
2 changed files with 8 additions and 4 deletions

View file

@ -726,8 +726,8 @@ export class NoteCreateService implements OnApplicationShutdown {
.where('id = :id', { id: renote.id })
.execute();
// 30%の確率ハイライト用ランキング更新
if (Math.random() < 0.3) {
// 30%の確率、3日以内に投稿されたートの場合ハイライト用ランキング更新
if (Math.random() < 0.3 && (Date.now() - this.idService.parse(renote.id).date.getTime()) < 1000 * 60 * 60 * 24 * 3) {
if (renote.channelId != null) {
if (renote.replyId == null) {
this.featuredService.updateInChannelNotesRanking(renote.channelId, renote.id, 5);