Hi, everyone!
To be short, I've written an api, to get a data from site and the return it in JSON from for my iOS app. It parses required pages every minute to sent to me the freshest results.
I've compiled it for a linux and launched it at the server.
The most funniest thing is that it works the full day, it gets data every minute but the night of the following day updating thread crashes. The code can still answer to requests as it is async but the thread for updating base is dead. I decided to figure out what's happening and found an error in logs. Its description would be lower. Note, that some time before it worked perfectly for maybe 2 or 3 weeks while I tested it. I've changed some lines of code after it but I didn't touch the part where error is located.
println!("Started collecting the Vec of all groups.");
let mut link_vec : Vec<String> = Vec::new();
let request = reqwest::get("https://www.shutterstock.com/search/celebrities?page=1/").await.unwrap().text().await.unwrap(); // It crashes here.
The error description is :
thread 'tokio-runtime-worker' panicked at 'called
Result::unwrap()
on anErr
value: reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("shutterstock.com")), port: None, path: "/search/celebrities?page=1", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Try again" })) }', src/ParseManage.rs:8:76
note: run withRUST_BACKTRACE=1
environment variable to display a backtrace
My provider also says that it's infrastructure is attacked and some problems may happen.
And my question is about the code. Is there a problem that I'm able to fix or should I just change my server provider? What does this error means?