pgpool2.git / summary / log / commit / refs

commit    b0728f29177ad8346bb097419248c77cfccfa925
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Mon Apr 23 05:54:21 2012 +0000

    Do not expire on memory query cache if memqcache_expire <= 0.


pool_memqcache.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pool_memqcache.c b/pool_memqcache.c index fbb11b77c..0cf1f57b5 100644 --- a/pool_memqcache.c +++ b/pool_memqcache.c @@ -2019,14 +2019,17 @@ static POOL_CACHEID *pool_find_item_on_shmem_cache(POOL_QUERY_HASH *query_hash) cih = item_header(block_address(c->blockid), c->itemid); /* Check cache expiration */ - now = time(NULL); - if (now > (cih->timestamp + pool_config->memqcache_expire)) + if (pool_config->memqcache_expire > 0) { - pool_debug("pool_find_item_on_shmem_cache: cache expired"); - pool_debug("pool_find_item_on_shmem_cache: now: %ld timestamp: %ld", - now, cih->timestamp + pool_config->memqcache_expire); - pool_delete_item_shmem_cache(c); - return NULL; + now = time(NULL); + if (now > (cih->timestamp + pool_config->memqcache_expire)) + { + pool_debug("pool_find_item_on_shmem_cache: cache expired"); + pool_debug("pool_find_item_on_shmem_cache: now: %ld timestamp: %ld", + now, cih->timestamp + pool_config->memqcache_expire); + pool_delete_item_shmem_cache(c); + return NULL; + } } cacheid.blockid = c->blockid; [parent: 21405c46bec0]