mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd: Add conf item to convey contextual diagnostic options.
This commit is contained in:
parent
42fd88d169
commit
3fedfaeb8d
3 changed files with 23 additions and 0 deletions
|
@ -46,6 +46,7 @@ bool nomatrix;
|
|||
bool matrix {true}; // matrix server by default.
|
||||
bool defaults;
|
||||
const char *bootstrap;
|
||||
const char *diagnostic;
|
||||
|
||||
lgetopt opts[]
|
||||
{
|
||||
|
@ -80,6 +81,7 @@ lgetopt opts[]
|
|||
{ "matrix", &matrix, lgetopt::BOOL, "Allow loading the matrix application module" },
|
||||
{ "defaults", &defaults, lgetopt::BOOL, "Use configuration defaults without database load for this execution" },
|
||||
{ "bootstrap", &bootstrap, lgetopt::STRING, "Bootstrap fresh database from event vector" },
|
||||
{ "diagnostic", &diagnostic, lgetopt::STRING, "Specify a diagnostic type in conjunction with other commands" },
|
||||
{ nullptr, nullptr, lgetopt::STRING, nullptr },
|
||||
};
|
||||
|
||||
|
@ -477,6 +479,9 @@ enable_coredumps()
|
|||
void
|
||||
applyargs()
|
||||
{
|
||||
if(diagnostic)
|
||||
ircd::diagnostic.set(diagnostic);
|
||||
|
||||
if(single && !bootstrap)
|
||||
{
|
||||
ircd::write_avoid.set("true");
|
||||
|
|
|
@ -111,6 +111,9 @@ namespace ircd
|
|||
extern const info::versions version_api;
|
||||
extern const info::versions version_abi;
|
||||
|
||||
// Diagnostic Mode Options
|
||||
extern conf::item<std::string> diagnostic;
|
||||
|
||||
// Operating Mode Selectors
|
||||
extern conf::item<bool> restart;
|
||||
extern conf::item<bool> debugmode;
|
||||
|
|
15
ircd/ircd.cc
15
ircd/ircd.cc
|
@ -140,6 +140,21 @@ ircd::read_only
|
|||
}
|
||||
};
|
||||
|
||||
/// Diagnostic options selection. This indicates whether any tests or special
|
||||
/// behavior should occur rather than normal operation; also allowing for
|
||||
/// fine-grained options to be conveyed to such tests/diagnostics. While this
|
||||
/// appears here as coarse library-wide option it does not on its own affect
|
||||
/// normal server operations just by being set. It affect things only if
|
||||
/// specific functionality checks and alters its behavior based on the value
|
||||
/// of this string contextually.
|
||||
decltype(ircd::diagnostic)
|
||||
ircd::diagnostic
|
||||
{
|
||||
{ "name", "ircd.diagnostic" },
|
||||
{ "default", string_view{} },
|
||||
{ "persist", false },
|
||||
};
|
||||
|
||||
/// Main context pointer placement.
|
||||
decltype(ircd::main_context)
|
||||
ircd::main_context;
|
||||
|
|
Loading…
Reference in a new issue