Skip to content

Commit

Permalink
Moved assets periodic update to once every 10 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoBiscosi committed Jan 22, 2025
1 parent a29a999 commit 2980bbf
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions src/LocalHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void LocalHost::periodic_stats_update(const struct timeval *tv) {
checkGatewayInfo();
/* If at least 5 minutes passed and the map was updated, dump the info */
float diff = Utils::msTimevalDiff(tv, &last_periodic_asset_update) / 1000; /* in Sec */
if ((diff > CONST_MAX_DUMP_DURATION) && asset_map_updated) {
if ((diff > CONST_ASSETS_PERIODIC_UPDATE) && asset_map_updated) {
memcpy(&last_periodic_asset_update, tv, sizeof(last_periodic_asset_update));
asset_map_updated = false;
dumpAssetInfo(false);
Expand Down Expand Up @@ -693,29 +693,6 @@ void LocalHost::setRouterMac(Mac *gw) {
}
}

/* *************************************** */

void LocalHost::toggleRxOnlyHost(bool rx_only) {
Host::toggleRxOnlyHost(rx_only);

if (isLocalUnicastHost()) {
char hostbuf[64], *member;

member = get_hostkey(hostbuf, sizeof(hostbuf));

if (is_rx_only) {
/* Add this host to the hash of RX-only local hosts */
char seenbuf[16];

snprintf(seenbuf, sizeof(seenbuf), "%u", (u_int32_t)get_last_seen());
ntop->getRedis()->hashSet(HASHKEY_LOCALHOST_RX_ONLY, member, seenbuf);
} else {
/* Delete the key in case it was present */
ntop->getRedis()->hashDel(HASHKEY_LOCALHOST_RX_ONLY, member);
}
}
}

/* ***************************************************** */

void LocalHost::setServerPort(bool isTCP, u_int16_t port, ndpi_protocol *proto,
Expand Down

0 comments on commit 2980bbf

Please sign in to comment.