Skip to content

Commit

Permalink
Always sleep a minimum of 1s between flushes.
Browse files Browse the repository at this point in the history
This has the downside of making it take at least a second to flush a
new item, but it's expected that any system with write volume will
probably have a good deal of traffic flowing through it, at which
point it won't make a huge difference.

Change-Id: I1ccaf7d1d39cd4f5df70c8daed5bc555b6995a09
Reviewed-on: http://review.northscale.com/915
Reviewed-by: Sean Lynch <seanl@literati.org>
Tested-by: Sean Lynch <seanl@literati.org>
  • Loading branch information
dustin authored and Sean Lynch committed Jun 25, 2010
1 parent ce80b62 commit 90bd1d4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions flusher.cc
Expand Up @@ -144,15 +144,11 @@ bool Flusher::step(Dispatcher &d, TaskId tid) {
case running:
{
int n = doFlush();
if (n > 0) {
if (_state == running) {
d.snooze(tid, n);
return true;
} else {
return false;
}
} else {
if (_state == running) {
d.snooze(tid, std::max(n, 1));
return true;
} else {
return false;
}
}
case stopping:
Expand Down

0 comments on commit 90bd1d4

Please sign in to comment.