Skip to content

Commit

Permalink
fix timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
francis-du committed Jan 20, 2021
1 parent 237148e commit c1dbfd1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/handler/get_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tide::http::mime;
use tide::{Request, Response, StatusCode};
use wikipedia::Wikipedia;

use crate::common::conf::CHILD_LINK_LIMIT;
use crate::common::conf::{CHILD_LINK_LIMIT, SEARCH_RESULTS_LIMIT};
use crate::common::network::ProxyClient;
use crate::common::semantics;

Expand Down Expand Up @@ -57,7 +57,7 @@ pub async fn search(req: Request<()>) -> tide::Result {
if query.limit.is_some() {
wiki.search_results = query.limit.unwrap();
} else {
wiki.search_results = 20
wiki.search_results = SEARCH_RESULTS_LIMIT
}

// limit results
Expand Down Expand Up @@ -89,8 +89,8 @@ pub async fn search(req: Request<()>) -> tide::Result {
for res in results {
let page = wiki.page_from_title(res.to_string());
let title = page.get_title().unwrap();
let links_iter = page.get_links().unwrap();
links_iter.filter(|&x| x.title.contains(words.clone()));
let links_iter = page.get_links().unwrap()
.filter(|x| x.title.clone().contains(words.clone()));

let id = match page.get_pageid().unwrap().parse::<u32>() {
Ok(i) => i,
Expand Down

0 comments on commit c1dbfd1

Please sign in to comment.