mirror of
https://github.com/Syfaro/fuzzysearch.git
synced 2024-11-23 15:22:31 +00:00
Other logging changes.
This commit is contained in:
parent
47703694d1
commit
36ea876043
@ -297,6 +297,8 @@ async fn insert_submission(
|
|||||||
.execute(conn)
|
.execute(conn)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
tracing::info!("Completed submission");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,17 +154,6 @@ async fn process_submission(
|
|||||||
hasher.update(&data);
|
hasher.update(&data);
|
||||||
let result: [u8; 32] = hasher.finalize().into();
|
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!(
|
sqlx::query!(
|
||||||
"INSERT INTO weasyl (id, hash, sha256, file_size, data) VALUES ($1, $2, $3, $4, $5)",
|
"INSERT INTO weasyl (id, hash, sha256, file_size, data) VALUES ($1, $2, $3, $4, $5)",
|
||||||
sub.id,
|
sub.id,
|
||||||
@ -176,6 +165,19 @@ async fn process_submission(
|
|||||||
.execute(pool)
|
.execute(pool)
|
||||||
.await?;
|
.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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user