mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Merge "stasis_cache: Stop caching stasis subscription change messages"
This commit is contained in:
@@ -817,29 +817,16 @@ static void caching_topic_exec(void *data, struct stasis_subscription *sub,
|
|||||||
|
|
||||||
msg_type = stasis_message_type(message);
|
msg_type = stasis_message_type(message);
|
||||||
|
|
||||||
if (stasis_subscription_change_type() == msg_type) {
|
|
||||||
struct stasis_subscription_change *change = stasis_message_data(message);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this change type is an unsubscribe, we need to find the original
|
* app_voicemail used to rely on the cache containing every topic subscribe and
|
||||||
* subscribe and remove it from the cache otherwise the cache will
|
* unsubscribe in order to determine if anyone was currently subscribed to a
|
||||||
* continue to grow unabated.
|
* particular mailbox. This caused the cache to grow unabated for the life of
|
||||||
|
* the asterisk instance. Since it no longer needs the cache of these message
|
||||||
|
* types, and no other function needs them, we no longer cache them.
|
||||||
*/
|
*/
|
||||||
if (strcmp(change->description, "Unsubscribe") == 0) {
|
if (stasis_subscription_change_type() == msg_type) {
|
||||||
struct stasis_cache_entry *sub;
|
|
||||||
|
|
||||||
ao2_wrlock(caching_topic->cache->entries);
|
|
||||||
sub = cache_find(caching_topic->cache->entries, stasis_subscription_change_type(), change->uniqueid);
|
|
||||||
if (sub) {
|
|
||||||
cache_remove(caching_topic->cache->entries, sub, stasis_message_eid(message));
|
|
||||||
ao2_cleanup(sub);
|
|
||||||
}
|
|
||||||
ao2_unlock(caching_topic->cache->entries);
|
|
||||||
ao2_cleanup(caching_topic_needs_unref);
|
ao2_cleanup(caching_topic_needs_unref);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
msg_put = message;
|
|
||||||
msg = message;
|
|
||||||
} else if (stasis_cache_clear_type() == msg_type) {
|
} else if (stasis_cache_clear_type() == msg_type) {
|
||||||
/* Cache clear event. */
|
/* Cache clear event. */
|
||||||
msg_put = NULL;
|
msg_put = NULL;
|
||||||
|
Reference in New Issue
Block a user