mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 20:30:11 +01:00
attempt to bump up counters if something has actually happened
This commit is contained in:
parent
39468c3877
commit
b03bb23f81
@ -55,6 +55,8 @@ void update_counters(struct session_data *sdata, struct __data *data, struct __c
|
|||||||
char key[MAX_MEMCACHED_KEY_LEN];
|
char key[MAX_MEMCACHED_KEY_LEN];
|
||||||
unsigned int flags=0;
|
unsigned int flags=0;
|
||||||
|
|
||||||
|
if(counters->c_virus + counters->c_duplicate + counters->c_ignore + counters->c_size + counters->c_stored_size <= 0) return;
|
||||||
|
|
||||||
if(cfg->update_counters_to_memcached == 1){
|
if(cfg->update_counters_to_memcached == 1){
|
||||||
|
|
||||||
/* increment counters to memcached */
|
/* increment counters to memcached */
|
||||||
@ -114,6 +116,8 @@ void update_counters(struct session_data *sdata, struct __data *data, struct __c
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#endif
|
#endif
|
||||||
|
if(counters->c_virus + counters->c_duplicate + counters->c_ignore + counters->c_size + counters->c_stored_size <= 0) return;
|
||||||
|
|
||||||
snprintf(buf, SMALLBUFSIZE-1, "UPDATE `%s` SET `rcvd`=`rcvd`+%llu, `virus`=`virus`+%llu, `duplicate`=`duplicate`+%llu, `ignore`=`ignore`+%llu, `size`=`size`+%llu, `stored_size`=`stored_size`+%llu", SQL_COUNTER_TABLE, counters->c_rcvd, counters->c_virus, counters->c_duplicate, counters->c_ignore, counters->c_size, counters->c_stored_size);
|
snprintf(buf, SMALLBUFSIZE-1, "UPDATE `%s` SET `rcvd`=`rcvd`+%llu, `virus`=`virus`+%llu, `duplicate`=`duplicate`+%llu, `ignore`=`ignore`+%llu, `size`=`size`+%llu, `stored_size`=`stored_size`+%llu", SQL_COUNTER_TABLE, counters->c_rcvd, counters->c_virus, counters->c_duplicate, counters->c_ignore, counters->c_size, counters->c_stored_size);
|
||||||
p_query(sdata, buf, cfg);
|
p_query(sdata, buf, cfg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user