diff options
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_cdb.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/lua/lua_cdb.c b/src/lua/lua_cdb.c index a7292da03..0b8c27b2a 100644 --- a/src/lua/lua_cdb.c +++ b/src/lua/lua_cdb.c @@ -64,13 +64,12 @@ lua_cdb_create (lua_State *L) else { cdb = g_malloc (sizeof (struct cdb)); cdb->filename = g_strdup (filename); - cdb->check_timer_ev = NULL; - cdb->check_timer_tv = NULL; if (cdb_init (cdb, fd) == -1) { msg_warn ("cannot open cdb: %s, %s", filename, strerror (errno)); lua_pushnil (L); } else { + cdb_add_timer (cdb, ev_default_loop (0), CDB_REFRESH_TIME); pcdb = lua_newuserdata (L, sizeof (struct cdb *)); rspamd_lua_setclass (L, "rspamd{cdb}", -1); *pcdb = cdb; @@ -106,13 +105,6 @@ lua_cdb_lookup (lua_State *L) lua_error (L); return 1; } - /* - * XXX: this code is placed here because event_loop is called inside workers, so start - * monitoring on first check, not on creation - */ - if (cdb->check_timer_ev == NULL) { - cdb_add_timer (cdb, CDB_REFRESH_TIME); - } what = luaL_checkstring (L, 2); if (cdb_find (cdb, what, strlen (what)) > 0) { |