lemmy: more debugging

This commit is contained in:
Colin 2023-06-11 11:24:15 +00:00
parent 3996e1be08
commit 79a7daca12
3 changed files with 27 additions and 0 deletions

View File

@ -32,6 +32,7 @@ in {
systemd.services.lemmy.environment = {
RUST_BACKTRACE = "full";
# RUST_LOG = "debug";
# RUST_LOG = "trace";
# upstream defaults LEMMY_DATABASE_URL = "postgres:///lemmy?host=/run/postgresql";
# - Postgres complains that we didn't specify a user
# lemmy formats the url as:

View File

@ -0,0 +1,24 @@
diff --git a/src/code_migrations.rs b/src/code_migrations.rs
index c69ce591..b416a299 100644
--- a/src/code_migrations.rs
+++ b/src/code_migrations.rs
@@ -36,7 +36,7 @@ use lemmy_db_schema::{
utils::{get_conn, naive_now, DbPool},
};
use lemmy_utils::{error::LemmyError, settings::structs::Settings};
-use tracing::info;
+use tracing::{debug, info};
use url::Url;
pub async fn run_advanced_migrations(pool: &DbPool, settings: &Settings) -> Result<(), LemmyError> {
@@ -419,7 +419,9 @@ async fn initialize_local_site_2022_10_10(
info!("Running initialize_local_site_2022_10_10");
// Check to see if local_site exists
- if LocalSite::read(pool).await.is_ok() {
+ let local_site = LocalSite::read(pool).await;
+ debug!("local_site: {local_site:?}");
+ if local_site.is_ok() {
return Ok(());
}
info!("No Local Site found, creating it.");

View File

@ -6,5 +6,7 @@ lemmy-server.overrideAttrs (upstream: {
./fix-db-migrations.patch
# log the database connection events, for debugging
# ./log-startup.patch
# print more debug info about specific problem paths i've encountered
# ./debug-db-migrations.patch
];
})