summaryrefslogtreecommitdiff
path: root/src/ratelimit.c
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2011-02-21 15:32:18 +0100
committerLennart Poettering <lennart@poettering.net>2011-02-28 23:04:18 +0100
commit4ce9faa9d283cbb4c46fd06138f6774579349fb7 (patch)
treed4211528629c353e19a4b27e5809a951a6b74b76 /src/ratelimit.c
parent35b8ca3aaf8cb044ad76675dfcad89e000dd4a5c (diff)
ratelimit: removed n_printed
Removed n_printed and renamed n_printed to num. This is not a logging rate limiter anymore.
Diffstat (limited to 'src/ratelimit.c')
-rw-r--r--src/ratelimit.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/ratelimit.c b/src/ratelimit.c
index 5adf1ae10d..1ddc83187f 100644
--- a/src/ratelimit.c
+++ b/src/ratelimit.c
@@ -38,25 +38,19 @@ bool ratelimit_test(RateLimit *r) {
if (r->begin <= 0 ||
r->begin + r->interval < ts) {
-
- if (r->n_missed > 0)
- log_warning("%u events suppressed", r->n_missed);
-
r->begin = ts;
- /* Reset counters */
- r->n_printed = 0;
- r->n_missed = 0;
+ /* Reset counter */
+ r->num = 0;
goto good;
}
- if (r->n_printed <= r->burst)
+ if (r->num <= r->burst)
goto good;
- r->n_missed++;
return false;
good:
- r->n_printed++;
+ r->num++;
return true;
}