From: Grigorii Demidov Date: Mon, 19 Mar 2018 14:37:14 +0000 (+0100) Subject: daemon/engine: remove cache cleaning timer since this functionality was relocated... X-Git-Tag: v2.2.0~1^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2ec53a39a9c45d746be1b24c441aa1c184d85b8;p=thirdparty%2Fknot-resolver.git daemon/engine: remove cache cleaning timer since this functionality was relocated to nsrep --- diff --git a/daemon/engine.c b/daemon/engine.c index 4eb39946e..a32b18d6f 100644 --- a/daemon/engine.c +++ b/daemon/engine.c @@ -649,20 +649,6 @@ static int init_state(struct engine *engine) return kr_ok(); } -static enum lru_apply_do update_stat_item(const char *key, uint len, - kr_nsrep_rtt_lru_entry_t *rtt_cache_entry, - void *baton) -{ - return rtt_cache_entry->score > KR_NS_LONG ? LRU_APPLY_DO_EVICT : LRU_APPLY_DO_NOTHING; -} -/** @internal Walk RTT table, clearing all entries with bad score - * to compensate for intermittent network issues or temporary bad behaviour. */ -static void update_state(uv_timer_t *handle) -{ - struct engine *engine = handle->data; - lru_apply(engine->resolver.cache_rtt, update_stat_item, NULL); -} - /** * Start luacov measurement and store results to file specified by * KRESD_COVERAGE_STATS environment variable. @@ -860,15 +846,6 @@ int engine_start(struct engine *engine) lua_gc(engine->L, LUA_GCSETPAUSE, 400); lua_gc(engine->L, LUA_GCRESTART, 0); - /* Set up periodic update function */ - uv_timer_t *timer = malloc(sizeof(*timer)); - if (timer) { - uv_timer_init(uv_default_loop(), timer); - timer->data = engine; - engine->updater = timer; - uv_timer_start(timer, update_state, CLEANUP_TIMER, CLEANUP_TIMER); - } - return kr_ok(); } @@ -877,10 +854,6 @@ void engine_stop(struct engine *engine) if (!engine) { return; } - if (engine->updater) { - uv_timer_stop(engine->updater); - uv_close((uv_handle_t *)engine->updater, (uv_close_cb) free); - } uv_stop(uv_default_loop()); } diff --git a/daemon/engine.h b/daemon/engine.h index 0e8264255..6d0a73b70 100644 --- a/daemon/engine.h +++ b/daemon/engine.h @@ -62,7 +62,6 @@ struct engine { array_t(const struct kr_cdb_api *) backends; fd_array_t ipc_set; knot_mm_t *pool; - uv_timer_t *updater; char *hostname; struct lua_State *L; char *moduledir;