+
+static void cs_hourlyfunc(void *arg) {
+ int i, total = 0, touched = 0, toorecent = 0;
+ chanindex *cip, *ncip;
+ regchan *rcp;
+ time_t t = time(NULL);
+
+ for (i=0;i<CHANNELHASHSIZE;i++) {
+ for (cip=chantable[i];cip;cip=ncip) {
+ ncip=cip->next;
+ if (!(rcp=cip->exts[chanservext]))
+ continue;
+
+ total++;
+
+ if(cip->channel && cs_ischannelactive(cip->channel, rcp)) {
+ rcp->lastactive = t;
+ if (rcp->lastcountersync < (t - COUNTERSYNCINTERVAL)) {
+ csdb_updatechannelcounters(rcp);
+ rcp->lastcountersync=t;
+ touched++;
+ } else {
+ toorecent++;
+ }
+ }
+
+ }
+ }
+ cs_log(NULL,"hourly update active completed, %d seen, %d touched, %d too recent to update.",total,touched,toorecent);
+}