]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 May 2007 00:30:23 +0000 (00:30 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 May 2007 00:30:23 +0000 (00:30 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5141 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core.c
src/switch_scheduler.c

index ab09373da4ad9adc17154b873e151f2928ae700d..022b101efd46f474e1dc1630b6a0e87dbd5bc090 100644 (file)
@@ -76,7 +76,7 @@ static void heartbeat_callback(switch_scheduler_task_t *task)
        send_heartbeat();
 
        /* reschedule this task */
-       task->runtime += 20;
+       task->runtime = time(NULL) + 20;
 }
 
 
index 5daa47c062221ee711a72253e5c2b5f7eb36c09c..a763fc7924ca1ba404c9e9b074710a41247200f6 100644 (file)
@@ -77,6 +77,11 @@ static int task_thread_loop(int done)
                } 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;