From e82ce6444cf5c89d708eb96d9b14be654e8cf846 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 6 Jan 2006 03:51:56 +0000 Subject: [PATCH] ITS#4308 fix cache flush task interval --- servers/slapd/back-bdb/cache.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index de2c35a6bf..e66836af61 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -643,11 +643,18 @@ bdb_cache_lru_add( ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex ); if ( bdb->bi_cache_task ) { if ( !ldap_pvt_runqueue_isrunning( &slapd_rq, - bdb->bi_cache_task )) + bdb->bi_cache_task )) { + struct re_s *task = bdb->bi_cache_task; + + /* We want it to start right now */ + task->interval.tv_sec = 0; ldap_pvt_runqueue_resched( &slapd_rq, bdb->bi_cache_task, 0 ); + /* But don't try to reschedule it while it's running */ + task->interval.tv_sec = 3600; + } } else { - bdb->bi_cache_task = ldap_pvt_runqueue_insert( &slapd_rq, 0, + bdb->bi_cache_task = ldap_pvt_runqueue_insert( &slapd_rq, 3600, bdb_cache_lru_purge, bdb, "bdb_cache_lru_purge", bdb->bi_dbenv_home ); } -- 2.39.5