X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fscheduled_tasks.rs;h=df54868fb5f8ce1e96a97a45b8621a32cf9a5935;hb=eacd4e44cdbe6dccfe2f23088e520ae2dfd6db54;hp=5b1ae419bc11f0918878fd08b368761011da0069;hpb=3f2a689edfddeb847753b44e7a42057de19ebbae;p=lemmy.git diff --git a/src/scheduled_tasks.rs b/src/scheduled_tasks.rs index 5b1ae419..df54868f 100644 --- a/src/scheduled_tasks.rs +++ b/src/scheduled_tasks.rs @@ -22,6 +22,7 @@ pub fn setup(pool: DbPool) -> Result<(), LemmyError> { active_counts(&conn); update_banned_when_expired(&conn); reindex_aggregates_tables(&conn, true); + drop_ccnew_indexes(&conn); }); let conn = pool.get()?; @@ -103,3 +104,13 @@ fn update_banned_when_expired(conn: &PgConnection) { .execute(conn) .expect("update banned when expires"); } + +/// Drops the phantom CCNEW indexes created by postgres +/// https://github.com/LemmyNet/lemmy/issues/2431 +fn drop_ccnew_indexes(conn: &PgConnection) { + info!("Dropping phantom ccnew indexes..."); + let drop_stmt = "select drop_ccnew_indexes()"; + sql_query(drop_stmt) + .execute(conn) + .expect("drop ccnew indexes"); +}