code: def on_timer(self):
          
          try:
              self.flush()
          except Exception as e:
              log.exception('Error while flushing: %s', e)
          self._set_timer()
docs: Executes flush(). Ignores any errors to make sure one exception
          doesn't halt the whole flushing process.