Skip to content

Flush interval doesn't flush buffer if it is not full #160

@Dim0N22

Description

@Dim0N22

The doc for _flushInterval says:

// Maximum number of seconds points can be held in buffer before are written to the db.
// Buffer is flushed when it reaches batch size or when flush interval runs out.
uint16_t _flushInterval;

However, it seems that due to passing true to InfluxDBClient::flushBufferInternal(bool flashOnlyFull), flushBufferInternal will actually do nothing even when it's time to flush.

I think we need to change this line

return flushBufferInternal(true);

to

return flushBufferInternal(false);

I also would be happy to cut a PR, but I don't know how to setup the environment for testing and run unit tests and unfortunately README doesn't help a lot (I use PlatformIO and consume the library from my project).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions