From c66c279fb65328c5a5f5d8ca6e0df035fc5c5555 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 16 Feb 2023 22:36:33 -0500 Subject: Added optional database query timeout --- lib/database.cpp | 5 +++++ lib/database.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/database.cpp b/lib/database.cpp index d5ff37e..d30926c 100644 --- a/lib/database.cpp +++ b/lib/database.cpp @@ -85,6 +85,11 @@ namespace verbly { return result; } + void database::setTimeout(int ms) + { + ppdb_.setTimeout(ms); + } + std::string database_version_mismatch::generateMessage(int right, int wrong) { std::ostringstream msgbuilder; diff --git a/lib/database.h b/lib/database.h index 83c4c1c..a9d711e 100644 --- a/lib/database.h +++ b/lib/database.h @@ -73,6 +73,8 @@ namespace verbly { std::set synrestrs(int partId) const; + void setTimeout(int ms); + private: mutable hatkirby::database ppdb_; -- cgit 1.4.1