+ .await
+ }
+
+ pub async fn update_hot_rank(
+ pool: &mut DbPool<'_>,
+ comment_id: CommentId,
+ ) -> Result<Self, Error> {
+ let conn = &mut get_conn(pool).await?;
+
+ diesel::update(comment_aggregates::table)
+ .filter(comment_aggregates::comment_id.eq(comment_id))
+ .set(comment_aggregates::hot_rank.eq(hot_rank(
+ comment_aggregates::score,
+ comment_aggregates::published,
+ )))
+ .get_result::<Self>(conn)
+ .await