Skip to content

Commit

Permalink
lib/srdb1: use the proper field for latency db limit
Browse files Browse the repository at this point in the history
(cherry picked from commit 7560edb)
  • Loading branch information
miconda committed Apr 3, 2019
1 parent 86944f5 commit 8d1996a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/srdb1/db_query.c
Expand Up @@ -47,14 +47,14 @@ static inline int db_do_submit_query(const db1_con_t* _h, const str *_query,
int ret;
unsigned int ms = 0;

if(unlikely(cfg_get(core, core_cfg, latency_limit_action)>0))
if(unlikely(cfg_get(core, core_cfg, latency_limit_db)>0))
ms = TICKS_TO_MS(get_ticks_raw());

ret = submit_query(_h, _query);

if(unlikely(cfg_get(core, core_cfg, latency_limit_action)>0)) {
if(unlikely(cfg_get(core, core_cfg, latency_limit_db)>0)) {
ms = TICKS_TO_MS(get_ticks_raw()) - ms;
if(ms >= cfg_get(core, core_cfg, latency_limit_action)) {
if(ms >= cfg_get(core, core_cfg, latency_limit_db)) {
LOG(cfg_get(core, core_cfg, latency_log),
"alert - query execution too long [%u ms] for [%.*s]\n",
ms, _query->len<50?_query->len:50, _query->s);
Expand Down

0 comments on commit 8d1996a

Please sign in to comment.