Refine the draft timeout control from server side.
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
#include <list>
|
||||
|
||||
#include "boost/lexical_cast.hpp"
|
||||
#include "boost/thread.hpp"
|
||||
#include "boost/date_time/posix_time/posix_time.hpp"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -115,10 +113,6 @@ bool BookListService::Handle(const std::string& http_method,
|
||||
std::string* response_content) {
|
||||
if (http_method == webcc::kHttpGet) {
|
||||
*response_content = CreateBookListJson(g_book_store.books());
|
||||
|
||||
// Sleep for testing timeout control.
|
||||
//boost::this_thread::sleep(boost::posix_time::seconds(2));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -146,9 +140,6 @@ bool BookDetailService::Handle(const std::string& http_method,
|
||||
|
||||
*response_content = CreateBookJson(book);
|
||||
|
||||
// Sleep for testing timeout control.
|
||||
//boost::this_thread::sleep(boost::posix_time::seconds(2));
|
||||
|
||||
return true;
|
||||
|
||||
} else if (http_method == webcc::kHttpPost) {
|
||||
|
||||
@@ -27,11 +27,6 @@ int main(int argc, char* argv[]) {
|
||||
server.RegisterService(std::make_shared<BookDetailService>(),
|
||||
"/books/(\\d+)");
|
||||
|
||||
// For test purpose.
|
||||
// Timeout like 60s makes more sense in a real product.
|
||||
// Leave it as default (0) for no timeout control.
|
||||
server.set_timeout_seconds(1);
|
||||
|
||||
server.Run();
|
||||
|
||||
} catch (std::exception& e) {
|
||||
|
||||
Reference in New Issue
Block a user