summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-11-12 13:14:39 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-11-12 13:14:39 +0100
commit0a5b731f2f18168795bcdefd9b6fa562dce6a0d5 (patch)
treec40937a25c2887cd267f8dcc43a00dece5d3258a /action.c
parent9407f2a3e08940d0dd0367c5904654f5a56117af (diff)
downloadrsyslog-0a5b731f2f18168795bcdefd9b6fa562dce6a0d5.tar.gz
rsyslog-0a5b731f2f18168795bcdefd9b6fa562dce6a0d5.tar.xz
rsyslog-0a5b731f2f18168795bcdefd9b6fa562dce6a0d5.zip
bugfix: $ActionExecOnlyOnceEveryInterval did not work.
This was a regression from the time() optimizations done in v4. Bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=143 Thanks to Klaus Tachtler for reporting this bug.
Diffstat (limited to 'action.c')
-rw-r--r--action.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/action.c b/action.c
index 51620fce..6d0b5da4 100644
--- a/action.c
+++ b/action.c
@@ -686,7 +686,7 @@ actionWriteToAction(action_t *pAction)
* a purely logical point of view. However, if safes us to check the system time in
* (those common) cases where ExecOnceInterval is not used. -- rgerhards, 2008-09-16
*/
- if(pAction->f_time != 0 && pAction->iSecsExecOnceInterval > 0 &&
+ if(pAction->iSecsExecOnceInterval > 0 &&
pAction->iSecsExecOnceInterval + pAction->tLastExec > getActNow(pAction)) {
/* in this case we need to discard the message - its not yet time to exec the action */
dbgprintf("action not yet ready again to be executed, onceInterval %d, tCurr %d, tNext %d\n",
@@ -697,6 +697,7 @@ actionWriteToAction(action_t *pAction)
}
/* we use reception time, not dequeue time - this is considered more appropriate and also faster ;) -- rgerhards, 2008-09-17 */
+ pAction->tLastExec = getActNow(pAction); /* re-init time flags */
pAction->f_time = pAction->f_pMsg->ttGenTime;
/* When we reach this point, we have a valid, non-disabled action.