0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-03-13 21:10:32 +01:00

ircd::db: Condition to check database from ircd::checkdb via -checkdb command line option.

This commit is contained in:
Jason Volk 2018-05-31 12:47:37 -07:00
parent fba300d900
commit 7461de8b3d
4 changed files with 12 additions and 7 deletions

View file

@ -54,6 +54,7 @@ lgetopt opts[] =
{ "execute", &execute, lgetopt::STRING, "Execute command lines immediately after startup" },
{ "nolisten", &ircd::nolisten, lgetopt::BOOL, "Normal execution but without listening sockets" },
{ "noautomod", &ircd::noautomod, lgetopt::BOOL, "Normal execution but without autoloading modules" },
{ "checkdb", &ircd::checkdb, lgetopt::BOOL, "Perform complete checks of databases when opening" },
{ nullptr, nullptr, lgetopt::STRING, nullptr },
};

View file

@ -186,6 +186,7 @@ namespace ircd
extern bool debugmode; ///< Toggle; available only ifdef RB_DEBUG
extern bool nolisten; ///< Init option to not bind listener socks.
extern bool noautomod; ///< Option to not load modules on init.
extern bool checkdb; ///< Perform checks on database opens
}
#include "string_view.h"

View file

@ -786,14 +786,16 @@ try
return checkpointer;
}()}
{
#ifdef RB_DEBUG
log::notice
if(ircd::checkdb)
{
log, "'%s': Verifying database integrity. This may take several minutes...",
this->name
};
check(*this);
#endif
log::notice
{
log, "'%s': Verifying database integrity. This may take several minutes...",
this->name
};
check(*this);
}
log::info
{

View file

@ -23,6 +23,7 @@ namespace ircd
bool debugmode; // meaningful ifdef RB_DEBUG
bool nolisten; // indicates no listener binding
bool noautomod; // no module loading on init
bool checkdb; // check databases when opening
void set_runlevel(const enum runlevel &);
void at_main_exit() noexcept;