axiomhq / axiom-lambda-extension

Ingest logs and platform events from your lambda functions
14 stars 2 forks source link

fix(flusher): Retry flush on exit #21

Closed bahlo closed 1 year ago

bahlo commented 1 year ago

The flusher keeps a batch of events so retrying doesn't make sense when we'll flush again with the next event.

But on exit there won't be a next event, so we need to retry there.

Because you can't set the retry behaviour after constructing an Axiom client, this creates a second one that retries and adds a RetryOpt to the Flush method.