@cryptotaxi247 / netdata-1 / commits / 252ff4f77

properly update the last time person urls and machine urls are accessed

Costa Tsaousis (ktsaou) committed May 14, 2016 at 14:13 UTC 252ff4f7799d183da6b5fe9ad3a8aaf94ced1544
1 file changed +4 -2
src/registry.c
+4 -2
@@ -617,6 +617,7 @@ static inline PERSON_URL *registry_person_link_to_url(PERSON *p, MACHINE *m, URL
617 else {
618 debug(D_REGISTRY, "registry_person_link_to_url('%s', '%s', '%s'): found", p->guid, m->guid, u->url);
619 pu->usages++;
620 + if(likely(pu->last_t < when)) pu->last_t = when;
621
622 if(pu->machine != m) {
623 MACHINE_URL *mu = dictionary_get(pu->machine->urls, u->url);
@@ -641,7 +642,7 @@ static inline PERSON_URL *registry_person_link_to_url(PERSON *p, MACHINE *m, URL
642 }
643
644 p->usages++;
644 - p->last_t = when;
645 + if(likely(p->last_t < when)) p->last_t = when;
646
647 if(pu->flags & REGISTRY_URL_FLAGS_EXPIRED) {
648 info("registry_person_link_to_url('%s', '%s', '%s'): accessing an expired URL. Re-enabling URL.", p->guid, m->guid, u->url);
@@ -667,13 +668,14 @@ static inline MACHINE_URL *registry_machine_link_to_url(PERSON *p, MACHINE *m, U
668 else {
669 debug(D_REGISTRY, "registry_machine_link_to_url('%s', '%s', '%s'): found", p->guid, m->guid, u->url);
670 mu->usages++;
671 + if(likely(mu->last_t < when)) mu->last_t = when;
672 }
673
674 //debug(D_REGISTRY, "registry_machine_link_to_url('%s', '%s', '%s'): indexing person in machine", p->guid, m->guid, u->url);
675 //dictionary_set(mu->persons, p->guid, p, sizeof(PERSON));
676
677 m->usages++;
676 - m->last_t = when;
678 + if(likely(m->last_t < when)) m->last_t = when;
679
680 if(mu->flags & REGISTRY_URL_FLAGS_EXPIRED) {
681 info("registry_machine_link_to_url('%s', '%s', '%s'): accessing an expired URL.", p->guid, m->guid, u->url);