Skip to content

Commit

Permalink
fix: use UTC midnight epoch instead of current epoch to calculate vid…
Browse files Browse the repository at this point in the history
…eo relevance score
  • Loading branch information
zeeshanakram3 committed Mar 12, 2024
1 parent c28c1ef commit f989967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/VideoRelevanceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class VideoRelevanceManager {
video.id as videoId,
channel.id as channelId,
(ROUND((
(extract(epoch from now()) - ${wtEpoch})
(extract(epoch FROM date_trunc('day', now() at time zone 'UTC')) - ${wtEpoch})
/ ${NEWNESS_SECONDS_DIVIDER} * ${newnessWeight * -1}
+ (views_num * ${viewsWeight})
+ (comments_count * ${commentsWeight})
Expand Down

0 comments on commit f989967

Please sign in to comment.