Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserter: handle INSERTs slower than max_duration #20

Closed
loyd opened this issue Aug 7, 2021 · 0 comments
Closed

Inserter: handle INSERTs slower than max_duration #20

loyd opened this issue Aug 7, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@loyd
Copy link
Collaborator

loyd commented Aug 7, 2021

Avoid the case of long executing INSERTs, where the spent time is more than max_duration in the following code:

let mut inserter = client.inserter("kek")
    .set_max_duration(Duration::from_millis(5));

while let Some(envelope) = ctx.recv().await {
    let row = make_row(envelope);
    inserter.write(row).await;
    // if time is exceeded,
    //   ends the current HTTP request and open another one.
    inserter.commit().await;
}

The simplest possible solution is just to skip ticks.

@loyd loyd added the enhancement New feature or request label Aug 7, 2021
@loyd loyd closed this as completed in 79228fb Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant