diff --git a/crates/federate/src/util.rs b/crates/federate/src/util.rs index f00ccadb3..f744d45f4 100644 --- a/crates/federate/src/util.rs +++ b/crates/federate/src/util.rs @@ -1,8 +1,5 @@ use anyhow::{anyhow, Context, Result}; -use diesel::{ - prelude::*, - sql_types::{Bool, Int8}, -}; +use diesel::prelude::*; use diesel_async::RunQueryDsl; use lemmy_apub::{ activity_lists::SharedInboxActivities, @@ -191,17 +188,11 @@ pub(crate) async fn get_latest_activity_id(pool: &mut DbPool<'_>) -> Result = sent_activity.select(max(id)).get_result(conn).await?; + let latest_id = seq.unwrap_or(0); anyhow::Result::<_, anyhow::Error>::Ok(latest_id as ActivityId) }) .await @@ -212,11 +203,3 @@ pub(crate) async fn get_latest_activity_id(pool: &mut DbPool<'_>) -> Result Duration { Duration::from_secs_f64(10.0 * 2.0_f64.powf(f64::from(retry_count))) } - -#[derive(QueryableByName)] -struct Sequence { - #[diesel(sql_type = Int8)] - last_value: i64, // this value is bigint for some reason even if sequence is int4 - #[diesel(sql_type = Bool)] - is_called: bool, -}