瀏覽代碼

do not schedule repeated jobs in the past; fixes #472

Julius Pfrommer 9 年之前
父節點
當前提交
d4bf5e03ce
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/server/ua_server_worker.c

+ 5 - 0
src/server/ua_server_worker.c

@@ -343,7 +343,12 @@ static UA_UInt16 processRepeatedJobs(UA_Server *server) {
             //processJobs may sort the list but dont delete entries
             processJobs(server, &tw->jobs[i].job, 1); // does not free the job ptr
 #endif
+
+        /* set the time for the next execution */
         tw->nextTime += tw->interval;
+        if(tw->nextTime < current)
+            tw->nextTime = current;
+
         //start iterating the list from the beginning
         struct RepeatedJobs *prevTw = LIST_FIRST(&server->repeatedJobs); // after which tw do we insert?
         while(UA_TRUE) {