MCPcopy Create free account
hub / github.com/Icinga/icinga2 / DeleteState

Method DeleteState

lib/icingadb/icingadb-objects.cpp:3178–3195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3176}
3177
3178void IcingaDB::DeleteState(const String& id, RedisConnection::QueryArg redisObjKey, RedisConnection::QueryArg redisChecksumKey) const
3179{
3180 Log(LogNotice, "IcingaDB")
3181 << "Deleting state '" << static_cast<std::string_view>(redisObjKey) << "' -> " << std::quoted(id.CStr());
3182
3183 RedisConnection::Queries hdels = {{"HDEL", std::move(redisObjKey), id}};
3184 if (!static_cast<std::string_view>(redisChecksumKey).empty()) {
3185 hdels.push_back({"HDEL", std::move(redisChecksumKey), id});
3186 }
3187
3188 m_RconWorker->FireAndForgetQueries(std::move(hdels));
3189 // TODO: This is currently purposefully commented out due to how Icinga DB (Go) handles runtime state
3190 // upsert and delete events. See https://github.com/Icinga/icingadb/pull/894 for more details.
3191 /*m_Rcon->FireAndForgetQueries({{
3192 "XADD", "icinga:runtime:state", "MAXLEN", "~", "1000000", "*",
3193 "redis_key", redisKey, "id", id, "runtime_type", "delete"
3194 }}, Prio::RuntimeStateStream, {0, 1});*/
3195}
3196
3197/**
3198 * Add the provided data to the provided map of HMSET queries.

Callers

nothing calls this directly

Calls 5

LogClass · 0.85
CStrMethod · 0.80
push_backMethod · 0.80
FireAndForgetQueriesMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected