mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-26 03:26:19 +00:00
no instrumentar funciones pesadas
arregla problemas de perf
This commit is contained in:
parent
8e8fe8ddaf
commit
1348bee6c7
2 changed files with 0 additions and 2 deletions
|
@ -2,7 +2,6 @@ use anyhow::Context;
|
||||||
|
|
||||||
use crate::PrecioPoint;
|
use crate::PrecioPoint;
|
||||||
|
|
||||||
#[tracing::instrument(skip(dom))]
|
|
||||||
pub fn parse(url: String, dom: &tl::VDom) -> Result<PrecioPoint, anyhow::Error> {
|
pub fn parse(url: String, dom: &tl::VDom) -> Result<PrecioPoint, anyhow::Error> {
|
||||||
let ean = dom
|
let ean = dom
|
||||||
.query_selector("div#brandText")
|
.query_selector("div#brandText")
|
||||||
|
|
|
@ -32,7 +32,6 @@ pub fn get_json_lds<'a>(
|
||||||
.filter_map(|n| n.as_tag())
|
.filter_map(|n| n.as_tag())
|
||||||
.map(|t| serde_json::from_str(&t.inner_html(dom.parser())))
|
.map(|t| serde_json::from_str(&t.inner_html(dom.parser())))
|
||||||
}
|
}
|
||||||
#[tracing::instrument]
|
|
||||||
pub fn find_json_ld(dom: &VDom, typ: &str) -> Option<Result<Ld, serde_json::Error>> {
|
pub fn find_json_ld(dom: &VDom, typ: &str) -> Option<Result<Ld, serde_json::Error>> {
|
||||||
get_json_lds(dom)
|
get_json_lds(dom)
|
||||||
.filter_map(|v| v.ok())
|
.filter_map(|v| v.ok())
|
||||||
|
|
Loading…
Reference in a new issue