-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update video relevance manager query * Remove single video schedules for relevance recalc * Fix namings * Reformat query * Revert "Remove single video schedules for relevance recalc" This reverts commit 3a685b9 * Adjust logic for single channel recalc * Unblock video relevance recalc only after processor reaches last exported block * Increase global recalc interval * Avoid query if set is empty * Introduce smaller interval for scheduled channels * Typo fix Co-authored-by: Zeeshan Akram <[email protected]> * Linter * Add video recalc on channel weight change --------- Co-authored-by: Zeeshan Akram <[email protected]>
- Loading branch information
1 parent
4c6e3af
commit c8b2c2e
Showing
9 changed files
with
109 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
import { EntityManager, In } from 'typeorm' | ||
import { CommentCountersManager } from '../../../utils/CommentsCountersManager' | ||
import { Comment } from '../../../model' | ||
import { VideoRelevanceManager } from '../../../utils/VideoRelevanceManager' | ||
|
||
export async function processCommentsCensorshipStatusUpdate(em: EntityManager, ids: string[]) { | ||
const manager = new CommentCountersManager() | ||
const videoRelevanceManager = new VideoRelevanceManager() | ||
const comments = await em.getRepository(Comment).find({ where: { id: In(ids) } }) | ||
comments.forEach((c) => { | ||
manager.scheduleRecalcForComment(c.parentCommentId) | ||
manager.scheduleRecalcForVideo(c.videoId) | ||
videoRelevanceManager.scheduleRecalcForVideo(c.videoId) | ||
}) | ||
await manager.updateVideoCommentsCounters(em) | ||
await manager.updateParentRepliesCounters(em) | ||
await videoRelevanceManager.updateVideoRelevanceValue(em) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters