mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 05:34:48 +02:00
parent
eed3a60c75
commit
215f500b0e
@ -191,7 +191,7 @@ void DbConnection::CleanUpHandler(void)
|
|||||||
{ "systemcommands", "start_time" }
|
{ "systemcommands", "start_time" }
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < sizeof(tables) / sizeof(tables[0]); i++) {
|
for (size_t i = 0; i < sizeof(tables) / sizeof(tables[0]); i++) {
|
||||||
double max_age = GetCleanup()->Get(tables[i].name + "_age");
|
double max_age = GetCleanup()->Get(tables[i].name + "_age");
|
||||||
|
|
||||||
if (max_age == 0)
|
if (max_age == 0)
|
||||||
|
@ -82,13 +82,13 @@ static Value ExternalCommandAPIWrapper(const String& command, const Dictionary::
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RegisterCommand(const String& command, const ExternalCommandCallback& callback, size_t minArgs = 0, size_t maxArgs = -1)
|
static void RegisterCommand(const String& command, const ExternalCommandCallback& callback, size_t minArgs = 0, size_t maxArgs = UINT_MAX)
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(GetMutex());
|
boost::mutex::scoped_lock lock(GetMutex());
|
||||||
ExternalCommandInfo eci;
|
ExternalCommandInfo eci;
|
||||||
eci.Callback = callback;
|
eci.Callback = callback;
|
||||||
eci.MinArgs = minArgs;
|
eci.MinArgs = minArgs;
|
||||||
eci.MaxArgs = (maxArgs == -1) ? minArgs : maxArgs;
|
eci.MaxArgs = (maxArgs == UINT_MAX) ? minArgs : maxArgs;
|
||||||
GetCommands()[command] = eci;
|
GetCommands()[command] = eci;
|
||||||
|
|
||||||
ApiFunction::Ptr afunc = make_shared<ApiFunction>(boost::bind(&ExternalCommandAPIWrapper, command, _2));
|
ApiFunction::Ptr afunc = make_shared<ApiFunction>(boost::bind(&ExternalCommandAPIWrapper, command, _2));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user