[sr-dev] git:3.3: modules_k/usrloc: Only run timer when timer_interval > 0

Peter Dunkley peter.dunkley at crocodile-rcs.com
Wed Jun 13 12:50:08 CEST 2012


Module: sip-router
Branch: 3.3
Commit: bcbddc795b4ffad3bfaa1b77a51b6cfd73239ff1
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bcbddc795b4ffad3bfaa1b77a51b6cfd73239ff1

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Wed Jun 13 11:47:07 2012 +0100

modules_k/usrloc: Only run timer when timer_interval > 0

- This is useful on DB only multi-server systems when the database is
  cleaned up outside of Kamailio.
- This is a re-instatement of something that worked before the
  addition of GRUU.
(cherry picked from commit b13434ff7f8e8b1b88434e888c26a77874eceeb0)

---

 modules_k/usrloc/ul_mod.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules_k/usrloc/ul_mod.c b/modules_k/usrloc/ul_mod.c
index 7cbf257..a6e7ebd 100644
--- a/modules_k/usrloc/ul_mod.c
+++ b/modules_k/usrloc/ul_mod.c
@@ -315,7 +315,10 @@ static int mod_init(void)
 
 	/* Register cache timer */
 	if(ul_timer_procs<=0)
-		register_timer(ul_core_timer, 0, timer_interval);
+	{
+		if (timer_interval > 0)
+			register_timer(ul_core_timer, 0, timer_interval);
+	}
 	else
 		register_sync_timers(ul_timer_procs);
 




More information about the sr-dev mailing list