Remove some logging and fix a comment
This commit is contained in:
parent
331fb4f11b
commit
879ddb112e
@ -44,7 +44,6 @@ pub async fn search(
|
|||||||
query: String,
|
query: String,
|
||||||
) -> Result<Connection<usize, ThreadSummary>, async_graphql::Error> {
|
) -> Result<Connection<usize, ThreadSummary>, async_graphql::Error> {
|
||||||
let query: Query = query.parse()?;
|
let query: Query = query.parse()?;
|
||||||
info!("news search query {query:?}");
|
|
||||||
let site = query.site.expect("search has no site");
|
let site = query.site.expect("search has no site");
|
||||||
connection::query(
|
connection::query(
|
||||||
after,
|
after,
|
||||||
@ -52,7 +51,6 @@ pub async fn search(
|
|||||||
first,
|
first,
|
||||||
last,
|
last,
|
||||||
|after: Option<usize>, before: Option<usize>, first, last| async move {
|
|after: Option<usize>, before: Option<usize>, first, last| async move {
|
||||||
info!("search page info {after:#?}, {before:#?}, {first:#?}, {last:#?}");
|
|
||||||
let default_page_size = 100;
|
let default_page_size = 100;
|
||||||
let (offset, limit) = match (after, before, first, last) {
|
let (offset, limit) = match (after, before, first, last) {
|
||||||
// Reasonable defaults
|
// Reasonable defaults
|
||||||
@ -86,7 +84,6 @@ pub async fn search(
|
|||||||
// The +1 is to see if there are more pages of data available.
|
// The +1 is to see if there are more pages of data available.
|
||||||
let limit = limit + 1;
|
let limit = limit + 1;
|
||||||
|
|
||||||
info!("search page offset {offset} limit {limit}");
|
|
||||||
let rows = sqlx::query_file!(
|
let rows = sqlx::query_file!(
|
||||||
"sql/threads.sql",
|
"sql/threads.sql",
|
||||||
site,
|
site,
|
||||||
@ -214,7 +211,7 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result<Thread, ServerEr
|
|||||||
let html = r.summary.unwrap_or("NO SUMMARY".to_string());
|
let html = r.summary.unwrap_or("NO SUMMARY".to_string());
|
||||||
// TODO: add site specific cleanups. For example:
|
// TODO: add site specific cleanups. For example:
|
||||||
// * Grafana does <div class="image-wrapp"><img class="lazyload>"<img src="/media/...>"</img></div>
|
// * Grafana does <div class="image-wrapp"><img class="lazyload>"<img src="/media/...>"</img></div>
|
||||||
// * Some sites appear to be HTML encoded, unencode them, i.e. imperialviolet
|
// * Some sites appear to be HTML encoded, unencode them, i.e. imperialviolent
|
||||||
let html = sanitize_html(&html, "", &link)?;
|
let html = sanitize_html(&html, "", &link)?;
|
||||||
let body = Body::Html(Html {
|
let body = Body::Html(Html {
|
||||||
html,
|
html,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user