From 2b29da0c2ea26907c964bef179337a2cc614a22c Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 27 Jun 2010 21:12:28 +0200 Subject: Check the cache DB every 15 minutes instead of checking on every write. --- src/gnutls_cache.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gnutls_cache.c b/src/gnutls_cache.c index 4d4a661..4d0a733 100644 --- a/src/gnutls_cache.c +++ b/src/gnutls_cache.c @@ -309,8 +309,14 @@ static int dbm_cache_expire(mgs_handle_t *ctxt) int keyidx = 0; int should_delete = 0; - apr_pool_create(&spool, ctxt->c->pool); ex = apr_time_now(); + + if (ex - ctxt->sc->last_cache_check < 900) + return 0; + + ctxt->sc->last_cache_check = ex; + + apr_pool_create(&spool, ctxt->c->pool); rv = apr_dbm_open(&dbm, ctxt->sc->cache_config, APR_DBM_READONLY, SSL_DBM_FILE_MODE, spool); -- cgit