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]
version = "0.19.4-beta.1b"
edition = "2021"

View file

@ -94,7 +94,7 @@ pub async fn setup(context: LemmyContext) -> Result<(), LemmyError> {
delete_old_denied_users(&mut context.pool()).await;
update_instance_software(&mut context.pool(), context.client())
.await
.inspect_err(|e| warn!("Failed to update instance software: {e}"))
.map_err(|e| warn!("Failed to update instance software: {e}"))
.ok();
}
});
@ -276,10 +276,10 @@ async fn delete_expired_captcha_answers(pool: &mut DbPool<'_>) {
)
.execute(&mut conn)
.await
.inspect(|_| {
.map(|_| {
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();
}
Err(e) => {
@ -300,7 +300,7 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
)
.execute(&mut conn)
.await
.inspect_err(|e| error!("Failed to clear old sent activities: {e}"))
.map_err(|e| error!("Failed to clear old sent activities: {e}"))
.ok();
diesel::delete(
@ -309,8 +309,8 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
)
.execute(&mut conn)
.await
.inspect(|_| info!("Done."))
.inspect_err(|e| error!("Failed to clear old received activities: {e}"))
.map(|_| info!("Done."))
.map_err(|e| error!("Failed to clear old received activities: {e}"))
.ok();
}
Err(e) => {
@ -322,10 +322,10 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
async fn delete_old_denied_users(pool: &mut DbPool<'_>) {
LocalUser::delete_old_denied_local_users(pool)
.await
.inspect(|_| {
.map(|_| {
info!("Done.");
})
.inspect(|e| error!("Failed to deleted old denied users: {e}"))
.map_err(|e| error!("Failed to deleted old denied users: {e}"))
.ok();
}
@ -348,10 +348,10 @@ async fn overwrite_deleted_posts_and_comments(pool: &mut DbPool<'_>) {
))
.execute(&mut conn)
.await
.inspect(|_| {
.map(|_| {
info!("Done.");
})
.inspect_err(|e| error!("Failed to overwrite deleted posts: {e}"))
.map_err(|e| error!("Failed to overwrite deleted posts: {e}"))
.ok();
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))
.execute(&mut conn)
.await
.inspect(|_| {
.map(|_| {
info!("Done.");
})
.inspect_err(|e| error!("Failed to overwrite deleted comments: {e}"))
.map_err(|e| error!("Failed to overwrite deleted comments: {e}"))
.ok();
}
Err(e) => {
@ -399,14 +399,14 @@ async fn active_counts(pool: &mut DbPool<'_>) {
sql_query(update_site_stmt)
.execute(&mut conn)
.await
.inspect_err(|e| error!("Failed to update site stats: {e}"))
.map_err(|e| error!("Failed to update site stats: {e}"))
.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);
sql_query(update_community_stmt)
.execute(&mut conn)
.await
.inspect_err(|e| error!("Failed to update community stats: {e}"))
.map_err(|e| error!("Failed to update community stats: {e}"))
.ok();
}
@ -433,7 +433,7 @@ async fn update_banned_when_expired(pool: &mut DbPool<'_>) {
.set(person::banned.eq(false))
.execute(&mut conn)
.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();
diesel::delete(
@ -441,7 +441,7 @@ async fn update_banned_when_expired(pool: &mut DbPool<'_>) {
)
.execute(&mut conn)
.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();
}
Err(e) => {