diff --git a/lemmy_apub/src/fetcher.rs b/lemmy_apub/src/fetcher.rs index 76d8b645e..0fb0cb10c 100644 --- a/lemmy_apub/src/fetcher.rs +++ b/lemmy_apub/src/fetcher.rs @@ -258,8 +258,12 @@ pub(crate) async fn get_or_fetch_and_upsert_user( recursion_counter, ) .await?; - // TODO: do we need to set this? would need a separate db call - //uf.last_refreshed_at = Some(naive_now()); + + let user_id = user.id; + blocking(context.pool(), move |conn| { + User_::mark_as_updated(conn, user_id) + }) + .await??; Ok(user) } diff --git a/lemmy_db/src/user.rs b/lemmy_db/src/user.rs index 2c4c67ea2..3f2efd2cc 100644 --- a/lemmy_db/src/user.rs +++ b/lemmy_db/src/user.rs @@ -188,6 +188,12 @@ impl User_ { .get_result::(conn) } + pub fn mark_as_updated(conn: &PgConnection, user_id: i32) -> Result { + diesel::update(user_.find(user_id)) + .set((updated.eq(naive_now()),)) + .get_result::(conn) + } + pub fn delete_account(conn: &PgConnection, user_id: i32) -> Result { diesel::update(user_.find(user_id)) .set((