[Freeswitch-svn] [commit] r5141 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Thu May 10 20:30:23 EDT 2007


Author: anthm
Date: Thu May 10 20:30:23 2007
New Revision: 5141

Modified:
   freeswitch/trunk/src/switch_core.c
   freeswitch/trunk/src/switch_scheduler.c

Log:
update

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Thu May 10 20:30:23 2007
@@ -76,7 +76,7 @@
 	send_heartbeat();
 
 	/* reschedule this task */
-	task->runtime += 20;
+	task->runtime = time(NULL) + 20;
 }
 
 

Modified: freeswitch/trunk/src/switch_scheduler.c
==============================================================================
--- freeswitch/trunk/src/switch_scheduler.c	(original)
+++ freeswitch/trunk/src/switch_scheduler.c	Thu May 10 20:30:23 2007
@@ -77,6 +77,11 @@
 		} else {
 			int64_t now = time(NULL);
 			if (now >= tp->task.runtime && !tp->in_thread) {
+				int32_t diff = now - tp->task.runtime;
+				if (diff > 1) {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Task was executed late by %d seconds %u %s (%s)\n",
+									  diff, tp->task.task_id, tp->desc, switch_str_nil(tp->task.group));
+				}
 				tp->executed = now;
 				if (switch_test_flag(tp, SSHF_OWN_THREAD)) {
 					switch_thread_t *thread;



More information about the Freeswitch-svn mailing list