Removing unstable inspect.

This commit is contained in:
Dessalines 2024-04-03 18:09:42 -04:00
parent 181bce8311
commit 3f0abbf24a
2 changed files with 16 additions and 19 deletions

View file

@ -1,6 +1,3 @@
[unstable]
result_option_inspect = true
[workspace.package] [workspace.package]
version = "0.19.4-beta.1b" version = "0.19.4-beta.1b"
edition = "2021" edition = "2021"

View file

@ -94,7 +94,7 @@ pub async fn setup(context: LemmyContext) -> Result<(), LemmyError> {
delete_old_denied_users(&mut context.pool()).await; delete_old_denied_users(&mut context.pool()).await;
update_instance_software(&mut context.pool(), context.client()) update_instance_software(&mut context.pool(), context.client())
.await .await
.inspect_err(|e| warn!("Failed to update instance software: {e}")) .map_err(|e| warn!("Failed to update instance software: {e}"))
.ok(); .ok();
} }
}); });
@ -276,10 +276,10 @@ async fn delete_expired_captcha_answers(pool: &mut DbPool<'_>) {
) )
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect(|_| { .map(|_| {
info!("Done."); info!("Done.");
}) })
.inspect_err(|e| error!("Failed to clear old captcha answers: {e}")) .map_err(|e| error!("Failed to clear old captcha answers: {e}"))
.ok(); .ok();
} }
Err(e) => { Err(e) => {
@ -300,7 +300,7 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
) )
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to clear old sent activities: {e}")) .map_err(|e| error!("Failed to clear old sent activities: {e}"))
.ok(); .ok();
diesel::delete( diesel::delete(
@ -309,8 +309,8 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
) )
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect(|_| info!("Done.")) .map(|_| info!("Done."))
.inspect_err(|e| error!("Failed to clear old received activities: {e}")) .map_err(|e| error!("Failed to clear old received activities: {e}"))
.ok(); .ok();
} }
Err(e) => { Err(e) => {
@ -322,10 +322,10 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
async fn delete_old_denied_users(pool: &mut DbPool<'_>) { async fn delete_old_denied_users(pool: &mut DbPool<'_>) {
LocalUser::delete_old_denied_local_users(pool) LocalUser::delete_old_denied_local_users(pool)
.await .await
.inspect(|_| { .map(|_| {
info!("Done."); info!("Done.");
}) })
.inspect(|e| error!("Failed to deleted old denied users: {e}")) .map_err(|e| error!("Failed to deleted old denied users: {e}"))
.ok(); .ok();
} }
@ -348,10 +348,10 @@ async fn overwrite_deleted_posts_and_comments(pool: &mut DbPool<'_>) {
)) ))
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect(|_| { .map(|_| {
info!("Done."); info!("Done.");
}) })
.inspect_err(|e| error!("Failed to overwrite deleted posts: {e}")) .map_err(|e| error!("Failed to overwrite deleted posts: {e}"))
.ok(); .ok();
info!("Overwriting deleted comments..."); info!("Overwriting deleted comments...");
@ -364,10 +364,10 @@ async fn overwrite_deleted_posts_and_comments(pool: &mut DbPool<'_>) {
.set(comment::content.eq(DELETED_REPLACEMENT_TEXT)) .set(comment::content.eq(DELETED_REPLACEMENT_TEXT))
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect(|_| { .map(|_| {
info!("Done."); info!("Done.");
}) })
.inspect_err(|e| error!("Failed to overwrite deleted comments: {e}")) .map_err(|e| error!("Failed to overwrite deleted comments: {e}"))
.ok(); .ok();
} }
Err(e) => { Err(e) => {
@ -399,14 +399,14 @@ async fn active_counts(pool: &mut DbPool<'_>) {
sql_query(update_site_stmt) sql_query(update_site_stmt)
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to update site stats: {e}")) .map_err(|e| error!("Failed to update site stats: {e}"))
.ok(); .ok();
let update_community_stmt = format!("update community_aggregates ca set users_active_{} = mv.count_ from community_aggregates_activity('{}') mv where ca.community_id = mv.community_id_", i.1, i.0); let update_community_stmt = format!("update community_aggregates ca set users_active_{} = mv.count_ from community_aggregates_activity('{}') mv where ca.community_id = mv.community_id_", i.1, i.0);
sql_query(update_community_stmt) sql_query(update_community_stmt)
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to update community stats: {e}")) .map_err(|e| error!("Failed to update community stats: {e}"))
.ok(); .ok();
} }
@ -433,7 +433,7 @@ async fn update_banned_when_expired(pool: &mut DbPool<'_>) {
.set(person::banned.eq(false)) .set(person::banned.eq(false))
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to update person.banned when expires: {e}")) .map_err(|e| error!("Failed to update person.banned when expires: {e}"))
.ok(); .ok();
diesel::delete( diesel::delete(
@ -441,7 +441,7 @@ async fn update_banned_when_expired(pool: &mut DbPool<'_>) {
) )
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to remove community_ban expired rows: {e}")) .map_err(|e| error!("Failed to remove community_ban expired rows: {e}"))
.ok(); .ok();
} }
Err(e) => { Err(e) => {