Do not serialize ASs/Countries when cache is disabled (fix #2987)

This commit is contained in:
Alfredo Cardigliano 2019-10-23 13:16:37 +02:00
parent 15e17a801a
commit ecd18b2d07
2 changed files with 8 additions and 4 deletions

View file

@ -34,13 +34,15 @@ AutonomousSystem::AutonomousSystem(NetworkInterface *_iface, IpAddress *ipa) : G
ntop->getTrace()->traceEvent(TRACE_NORMAL, "Created Autonomous System %u", asn);
#endif
deserializeFromRedis();
if(ntop->getPrefs()->is_idle_local_host_cache_enabled())
deserializeFromRedis();
}
/* *************************************** */
AutonomousSystem::~AutonomousSystem() {
serializeToRedis();
if(ntop->getPrefs()->is_idle_local_host_cache_enabled())
serializeToRedis();
if(asname) free(asname);
/* TODO: decide if it is useful to dump AS stats to redis */