[Asterisk-code-review] stasis cache: Don't cache stasis subscription change messages (asterisk[15])

George Joseph asteriskteam at digium.com
Thu Aug 30 13:11:34 CDT 2018


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/10024


Change subject: stasis_cache: Don't cache stasis_subscription_change messages
......................................................................

stasis_cache: Don't cache stasis_subscription_change messages

stasis_subscription_change messages can provide useful information
to topic subscribers but caching them makes no sense since they
don't alter the state of the object the topic is related to.
They do however take CPU cycles to manage in the cache and consume
memory in the cache container.

Change-Id: I3d18905e477f3721815da91f30da8d3fbb2d4f56
---
M main/stasis_cache.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/24/10024/1

diff --git a/main/stasis_cache.c b/main/stasis_cache.c
index 8c3c7f1..752bb8c 100644
--- a/main/stasis_cache.c
+++ b/main/stasis_cache.c
@@ -813,7 +813,9 @@
 	}
 
 	msg_type = stasis_message_type(message);
-	if (stasis_cache_clear_type() == msg_type) {
+	if (stasis_subscription_change_type() == msg_type) {
+		return;
+	} else if (stasis_cache_clear_type() == msg_type) {
 		/* Cache clear event. */
 		msg_put = NULL;
 		msg = stasis_message_data(message);

-- 
To view, visit https://gerrit.asterisk.org/10024
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d18905e477f3721815da91f30da8d3fbb2d4f56
Gerrit-Change-Number: 10024
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180830/08c472a3/attachment.html>


More information about the asterisk-code-review mailing list