From 323b154e0bd1d8efe17a5d90c601d3bf4db4771c Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 18 Dec 2024 12:03:10 +0100 Subject: [PATCH] Fix startup errors, add ci check (fixes #5209) --- .woodpecker.yml | 13 ++++++- crates/db_schema/replaceable_schema/utils.sql | 36 +++++++++---------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 8bbae613e..985207f86 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -178,7 +178,18 @@ steps: CARGO_HOME: .cargo_home commands: - cargo build - - mv target/debug/lemmy_server target/lemmy_server + - cp target/debug/lemmy_server target/lemmy_server + when: *slow_check_paths + + startup_errors: + image: *rust_image + environment: + LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy + CARGO_HOME: .cargo_home + commands: + - timeout --preserve-status 30 cargo run > lemmy.log 2>&1 + - cat lemmy.log + - "! grep ERROR lemmy.log" when: *slow_check_paths check_diesel_migration: diff --git a/crates/db_schema/replaceable_schema/utils.sql b/crates/db_schema/replaceable_schema/utils.sql index 0c7f42ff2..a9b32f3dd 100644 --- a/crates/db_schema/replaceable_schema/utils.sql +++ b/crates/db_schema/replaceable_schema/utils.sql @@ -186,26 +186,26 @@ BEGIN AND pe.bot_account = FALSE UNION SELECT - pl.person_id, + pa.person_id, p.community_id FROM - post_like pl - INNER JOIN post p ON pl.post_id = p.id - INNER JOIN person pe ON pl.person_id = pe.id + post_actions pa + INNER JOIN post p ON pa.post_id = p.id + INNER JOIN person pe ON pa.person_id = pe.id WHERE - pl.published > ('now'::timestamp - i::interval) + pa.liked > ('now'::timestamp - i::interval) AND pe.bot_account = FALSE UNION SELECT - cl.person_id, + ca.person_id, p.community_id FROM - comment_like cl - INNER JOIN comment c ON cl.comment_id = c.id + comment_actions ca + INNER JOIN comment c ON ca.comment_id = c.id INNER JOIN post p ON c.post_id = p.id - INNER JOIN person pe ON cl.person_id = pe.id + INNER JOIN person pe ON ca.person_id = pe.id WHERE - cl.published > ('now'::timestamp - i::interval) + ca.liked > ('now'::timestamp - i::interval) AND pe.bot_account = FALSE) a GROUP BY community_id; @@ -244,22 +244,22 @@ BEGIN AND pe.bot_account = FALSE UNION SELECT - pl.person_id + pa.person_id FROM - post_like pl - INNER JOIN person pe ON pl.person_id = pe.id + post_actions pa + INNER JOIN person pe ON pa.person_id = pe.id WHERE - pl.published > ('now'::timestamp - i::interval) + pa.liked > ('now'::timestamp - i::interval) AND pe.local = TRUE AND pe.bot_account = FALSE UNION SELECT - cl.person_id + ca.person_id FROM - comment_like cl - INNER JOIN person pe ON cl.person_id = pe.id + comment_actions ca + INNER JOIN person pe ON ca.person_id = pe.id WHERE - cl.published > ('now'::timestamp - i::interval) + ca.liked > ('now'::timestamp - i::interval) AND pe.local = TRUE AND pe.bot_account = FALSE) a; RETURN count_;