From 685361eaf3563d97c3d0f89f3853299948dc770f Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 13 Mar 2018 16:25:01 -0400 Subject: Added timeout to image downloads --- advice.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'advice.cpp') diff --git a/advice.cpp b/advice.cpp index ab16571..c3852b0 100644 --- a/advice.cpp +++ b/advice.cpp @@ -101,6 +101,8 @@ void advice::run() const curl::curl_easy lsthandle(lstios); std::string lsturl = pictured.getNotion().getImageNetUrl(); lsthandle.add(lsturl.c_str()); + lsthandle.add(30); + lsthandle.add(300); try { @@ -158,6 +160,7 @@ void advice::run() const imghandle.add(headers.get()); imghandle.add(url.c_str()); imghandle.add(30); + imghandle.add(300); try { @@ -202,7 +205,7 @@ void advice::run() const { throw could_not_get_images(); } - + std::string title = generator_->generate(); // Want a 16:9 aspect @@ -316,7 +319,7 @@ void advice::run() const client_->updateStatus(tweetText, {media_id}); std::cout << "Tweeted!" << std::endl << "Waiting..." << std::endl; - + std::this_thread::sleep_for(std::chrono::hours(1)); } catch (const could_not_get_images& ex) { -- cgit 1.4.1