Skip to content

Commit

Permalink
New force flag
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jan 16, 2019
1 parent 5cf4e0e commit 154e330
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/loggly/base.py
Expand Up @@ -91,8 +91,8 @@ def log_buffer(self, payload):
time.time() > self._last_flush + self.timeout
if should_flush: self._flush_buffer()

def log_flush(self):
self._flush_buffer()
def log_flush(self, force = True):
self._flush_buffer(force = force)

def _flush_buffer(self, force = False):
# retrieves some references from the current instance that
Expand All @@ -112,7 +112,7 @@ def _flush_buffer(self, force = False):
# schedules the call log operation and then empties the buffer
# so that it's no longer going to be used (flushed), notice that
# in case there's no delayer available calls the method immediately
if self.delayer: self.delayer(call_log)
if self.delayer and not force: self.delayer(call_log)
else: call_log()
self._buffer = []
self._last_flush = time.time()
Expand Down

0 comments on commit 154e330

Please sign in to comment.