Improve peformance of search indexing, v2 fixes + new routes (#205)

* Refactor search to not spam the database with queries, new utility routes for V2

* Run prepare
This commit is contained in:
Geometrically
2021-06-02 18:33:11 -07:00
committed by GitHub
parent 16db28060c
commit 157962e42a
18 changed files with 833 additions and 763 deletions

View File

@@ -78,7 +78,9 @@ impl super::Validator for PackValidator {
&self,
archive: &mut ZipArchive<Cursor<&[u8]>>,
) -> Result<ValidationResult, ValidationError> {
let mut file = archive.by_name("index.json")?;
let mut file = archive.by_name("index.json").map_err(|_| {
ValidationError::InvalidInputError("Pack manifest is missing.".to_string())
})?;
let mut contents = String::new();
file.read_to_string(&mut contents)?;