From 36ea876043fa14bcc38ee81df2e95f6c60245605 Mon Sep 17 00:00:00 2001 From: Syfaro Date: Wed, 21 Apr 2021 21:59:19 -0400 Subject: [PATCH] Other logging changes. --- fuzzysearch-ingest-e621/src/main.rs | 2 ++ fuzzysearch-ingest-weasyl/src/main.rs | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/fuzzysearch-ingest-e621/src/main.rs b/fuzzysearch-ingest-e621/src/main.rs index 19b1349..6b96865 100644 --- a/fuzzysearch-ingest-e621/src/main.rs +++ b/fuzzysearch-ingest-e621/src/main.rs @@ -297,6 +297,8 @@ async fn insert_submission( .execute(conn) .await?; + tracing::info!("Completed submission"); + Ok(()) } diff --git a/fuzzysearch-ingest-weasyl/src/main.rs b/fuzzysearch-ingest-weasyl/src/main.rs index c07903f..4c5f821 100644 --- a/fuzzysearch-ingest-weasyl/src/main.rs +++ b/fuzzysearch-ingest-weasyl/src/main.rs @@ -154,17 +154,6 @@ async fn process_submission( hasher.update(&data); let result: [u8; 32] = hasher.finalize().into(); - faktory - .queue_webhook(fuzzysearch_common::types::WebHookData { - site: fuzzysearch_common::types::Site::Weasyl, - site_id: sub.id, - artist: sub.owner_login.clone(), - file_url: sub.media.submission.first().unwrap_or_log().url.clone(), - file_sha256: Some(result.to_vec()), - hash: num.map(|hash| hash.to_be_bytes()), - }) - .await?; - sqlx::query!( "INSERT INTO weasyl (id, hash, sha256, file_size, data) VALUES ($1, $2, $3, $4, $5)", sub.id, @@ -176,6 +165,19 @@ async fn process_submission( .execute(pool) .await?; + tracing::info!("Completed submission"); + + faktory + .queue_webhook(fuzzysearch_common::types::WebHookData { + site: fuzzysearch_common::types::Site::Weasyl, + site_id: sub.id, + artist: sub.owner_login.clone(), + file_url: sub.media.submission.first().unwrap_or_log().url.clone(), + file_sha256: Some(result.to_vec()), + hash: num.map(|hash| hash.to_be_bytes()), + }) + .await?; + Ok(()) }