[svn-commits] irroot: branch irroot/asterisk-trunk-quack-queue r345429 - /team/irroot/aster...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Nov 15 13:33:54 CST 2011


Author: irroot
Date: Tue Nov 15 13:33:51 2011
New Revision: 345429

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=345429
Log:
Some clean up's fix reload time

Modified:
    team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c

Modified: team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c?view=diff&rev=345429&r1=345428&r2=345429
==============================================================================
--- team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c (original)
+++ team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c Tue Nov 15 13:33:51 2011
@@ -2667,7 +2667,8 @@
 	}
 
 	/* if im reloading realtime (CLI/AMI) i ignore cache timer */
-	if (!reload_realtime && oldq && !ast_tvzero(oldq->reload) && ast_tvdiff_sec(ast_tvnow(), oldq->reload)) {
+	if (!reload_realtime && oldq && !ast_tvzero(oldq->reload) &&
+	    (ast_tvcmp(ast_tvnow(), oldq->reload) >= 0)) {
 		ast_debug(1, "Not reloading queue %s for next %ld Seconds\n", oldq->name, (long)ast_tvdiff_sec(oldq->reload, ast_tvnow()));
 		return oldq;
 	}
@@ -2675,7 +2676,7 @@
 	/* Check if queue is defined in realtime if im reloading */
 	if (!(queue_vars = ast_load_realtime("queues", "name", queuename, SENTINEL))) {
 		/* Delete queue from in-core list if it has been deleted in realtime.
-		 * ! \note On DB failure the queue will be removed as i cant distinguish a DB failure 
+		 * ! \note On DB failure the queue will be removed as i cant distinguish a DB failure
 		 */
 		if (oldq) {
 			ast_debug(1, "Queue %s not found in realtime.\n", queuename);
@@ -2834,7 +2835,7 @@
 		/* We have higher priority than the current user, enter
 		 * before him, after all the other users with priority
 		 * higher or equal to our priority. */
-		if ((!inserted) && qe && (qe->prio > cur->prio)) {
+		if (!inserted && qe && (qe->prio > cur->prio)) {
 			AST_LIST_INSERT_BEFORE_CURRENT(qe, next);
 			insert_entry(qe, &pos);
 			inserted = 1;
@@ -3802,11 +3803,9 @@
 	ao2_unlock(call->member);
 
 	if (qe->parent->autopause != QUEUE_AUTOPAUSE_OFF && pause) {
-		if (qe->parent->autopausedelay > 0) {
-			if (!ast_tvzero(call->member->lastcall) &&
-			    (ast_tvdiff_sec(ast_tvnow(), call->member->lastcall) < qe->parent->autopausedelay)) {
-				return;
-			}
+		if ((qe->parent->autopausedelay > 0) && !ast_tvzero(call->member->lastcall) &&
+		    (ast_tvdiff_sec(ast_tvnow(), call->member->lastcall) < qe->parent->autopausedelay)) {
+			return;
 		}
 		if (qe->parent->autopause == QUEUE_AUTOPAUSE_ON) {
 			ao2_lock(call->member);




More information about the svn-commits mailing list