diff options
author | Matt Jordan <mjordan@digium.com> | 2015-06-05 18:04:17 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-06-05 18:04:17 -0500 |
commit | 5788c6db6755d26fc06ef87de7c6d5e43ae41bea (patch) | |
tree | 0493cd8d7bdb65e43587ec29422a64559d500b26 | |
parent | 9fca378b36918aaf8c697bd4138260f68b968c03 (diff) | |
parent | 128fe4cee8d1bc38471872b1e51ee2eb4cb9b7ae (diff) |
Merge "res_sorcery_memory_cache: Implement expire_on_reload option."
-rw-r--r-- | res/res_sorcery_memory_cache.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/res/res_sorcery_memory_cache.c b/res/res_sorcery_memory_cache.c index 57feb8f4f..10ef59a35 100644 --- a/res/res_sorcery_memory_cache.c +++ b/res/res_sorcery_memory_cache.c @@ -888,6 +888,15 @@ static void sorcery_memory_cache_load(void *data, const struct ast_sorcery *sorc */ static void sorcery_memory_cache_reload(void *data, const struct ast_sorcery *sorcery, const char *type) { + struct sorcery_memory_cache *cache = data; + + if (!cache->expire_on_reload) { + return; + } + + ao2_wrlock(cache->objects); + remove_all_from_cache(cache); + ao2_unlock(cache->objects); } /*! |