summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-06-04 07:33:30 -0300
committerJoshua Colp <jcolp@digium.com>2015-06-04 07:33:30 -0300
commit19de2bbc5fc8369b8ef4ec9531612bb72b495848 (patch)
tree4ee2dd091435a35c6293868cd36a3ef812bb4ce0 /res
parentd355ee7ff3cfe1737d80da874ea93eee340cdf6f (diff)
res_sorcery_memory_cache: Add test event when a refresh occurs.
This change adds a testsuite event for when a refresh occurs. This is useful as it provides a guaranteed mechanism of knowing when it has occurred instead of waiting an arbitrary amount of time. ASTERISK-25067 Reported by: Matt Jordan Change-Id: Iaa6b8d2d6bab7f99ee08e1c8908b8272a8987e65
Diffstat (limited to 'res')
-rw-r--r--res/res_sorcery_memory_cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_sorcery_memory_cache.c b/res/res_sorcery_memory_cache.c
index d2c648cff..57feb8f4f 100644
--- a/res/res_sorcery_memory_cache.c
+++ b/res/res_sorcery_memory_cache.c
@@ -789,6 +789,10 @@ static int stale_item_update(const void *data)
object);
}
+ ast_test_suite_event_notify("SORCERY_MEMORY_CACHE_REFRESHED", "Cache: %s\r\nType: %s\r\nName: %s\r\n",
+ task_data->cache->name, ast_sorcery_object_get_type(task_data->object),
+ ast_sorcery_object_get_id(task_data->object));
+
ao2_ref(task_data, -1);
end_stale_update();