userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
postgres_control.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/testsuite/postgres_control.hpp
4
/// @brief @copybrief testsuite::PostgresControl
5
6
#
include
<
chrono
>
7
8
#
include
<
userver
/
engine
/
deadline
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
testsuite {
13
14
/// @brief Testsuite overrides for PostgreSQL query timeouts
15
class
PostgresControl
{
16
public
:
17
enum
class
ReadonlyMaster { kNotExpected, kExpected };
18
19
PostgresControl() =
default
;
20
21
PostgresControl(
22
std::chrono::milliseconds network_timeout,
23
std::chrono::milliseconds statement_timeout,
24
ReadonlyMaster readonly_master
25
);
26
27
[[
nodiscard
]] engine::Deadline MakeExecuteDeadline(std::chrono::milliseconds duration)
const
;
28
29
[[
nodiscard
]] std::chrono::milliseconds MakeStatementTimeout(std::chrono::milliseconds duration)
const
;
30
31
bool
IsReadonlyMasterExpected()
const
;
32
33
private
:
34
std::chrono::milliseconds network_timeout_{};
35
std::chrono::milliseconds statement_timeout_{};
36
bool
is_readonly_master_expected_{
false
};
37
};
38
39
}
// namespace testsuite
40
41
USERVER_NAMESPACE_END
userver
testsuite
postgres_control.hpp
Generated on
for userver by
Doxygen
1.17.0