Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
cn-kali-team committed Nov 26, 2023
1 parent 8a9e8c2 commit e1f179b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions helper/src/bin/cve_to_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,8 @@ fn main() {
let gz_decoder = flate2::read::GzDecoder::new(gz_open_file);
let file = BufReader::new(gz_decoder);
let c: CVEContainer = serde_json::from_reader(file).unwrap();
let mut count = 0;
for w in c.CVE_Items {
count += 1;
import_to_db(connection_pool.get().unwrap().deref_mut(), w).unwrap_or_default();
if count == 100 {
std::process::exit(0);
}
// break;
}
break;
}
}
4 changes: 2 additions & 2 deletions nvd-yew/src/services/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ where
request(reqwest::Method::PUT, url, query, body).await
}
#[allow(dead_code)]
pub async fn request_delete<B, Q, T>(url: String) -> Result<T, Error>
pub async fn request_delete<B, Q, T>(url: String, query: Q, body: B) -> Result<T, Error>
where
T: DeserializeOwned + 'static + std::fmt::Debug,
Q: Serialize + std::fmt::Debug,
B: Serialize + std::fmt::Debug,
{
request(reqwest::Method::DELETE, url, (), ()).await
request(reqwest::Method::DELETE, url, query, body).await
}

0 comments on commit e1f179b

Please sign in to comment.