From 1f3fcc966a2f46f22690c397da98918556ffb435 Mon Sep 17 00:00:00 2001 From: bookug Date: Sun, 6 Aug 2017 22:15:55 +0800 Subject: [PATCH] perf: no backup and limit time in Endpoint no need to use backup function when ghttp used as SPARQL Endpoint; query time is limited to 1 minute in SPARQL Endpoint by default; by zengli --- Database/Database.cpp | 5 +++++ Main/ghttp.cpp | 6 ++++-- Server/web/freebase/index.js | 1 + Util/Util.h | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Database/Database.cpp b/Database/Database.cpp index 03aafd3..dcba8ac 100644 --- a/Database/Database.cpp +++ b/Database/Database.cpp @@ -1083,6 +1083,11 @@ Database::load_vstree(unsigned _vstree_size) void Database::check() { +cout<<"triple num: "<triples_num<pre_num<entity_num<literal_num<kvstore->getIDByPredicate(""); //cout<<"check: pre "<content.rdbuf() << endl; server_thread.join(); - cout<<"check: server stoped"< ?o . \n" + "\t?s ?s2 . \n" + "\t?s2 ?o . \n" + + "\t ?s2 . \n" + "} \n"; } diff --git a/Util/Util.h b/Util/Util.h index 50c941f..367ea31 100644 --- a/Util/Util.h +++ b/Util/Util.h @@ -293,7 +293,12 @@ public: static std::string gserver_port_file; static std::string gserver_port_swap; static std::string gserver_log; + //NOTICE: for endpoints, just set to 1 minute +#ifdef SPARQL_ENDPOINT + static const int gserver_query_timeout = 60; // Timeout of gServer's query (in seconds) +#else static const int gserver_query_timeout = 10000; // Timeout of gServer's query (in seconds) +#endif static std::string backup_path; static const long gserver_backup_interval = 86400;