[asterisk-commits] bweschke: branch bweschke/eventq-sanity-checks r58829 - /team/bweschke/eventq...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Mar 12 08:30:53 MST 2007


Author: bweschke
Date: Mon Mar 12 10:30:53 2007
New Revision: 58829

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58829
Log:
 Putting in code to purge stale events. 


Modified:
    team/bweschke/eventq-sanity-checks/main/manager.c

Modified: team/bweschke/eventq-sanity-checks/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/eventq-sanity-checks/main/manager.c?view=diff&rev=58829&r1=58828&r2=58829
==============================================================================
--- team/bweschke/eventq-sanity-checks/main/manager.c (original)
+++ team/bweschke/eventq-sanity-checks/main/manager.c Mon Mar 12 10:30:53 2007
@@ -2218,7 +2218,9 @@
 		/* Purge master event queue of old, unused events, but make sure we
 		   always keep at least one in the queue */
 		eqe = master_eventq;
-		while (master_eventq->next && !master_eventq->usecount) {
+		while (master_eventq->next && (!master_eventq->usecount || master_eventq->timeposted < (now - (maxeventage * 1000))) ) {
+			if (master_eventq->timeposted < (now - (maxeventage * 1000)) && option_debug > 2)
+				ast_log(LOG_DEBUG, "Event is beyond max event age. Purging it.\n");
 			eqe = master_eventq;
 			master_eventq = master_eventq->next;
 			free(eqe);



More information about the asterisk-commits mailing list