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

Fix flushInterval in context module #272

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Fix flushInterval in context module #272

merged 1 commit into from
Aug 5, 2024

Conversation

knolleary
Copy link
Member

The context module was not honouring the flushInterval - instead, every write to context was triggering a flush.

This ensure the module picks up the flushInterval (default 30s) properly.

@knolleary knolleary requested a review from hardillb August 5, 2024 14:18
@hardillb
Copy link
Contributor

hardillb commented Aug 5, 2024

@knolleary while you are at it can you fix line 23 which picks the large or 0 or the (configured value || 30) which means it can be configured to less than 30, which I don't think we want.

@knolleary
Copy link
Member Author

knolleary commented Aug 5, 2024

@hardillb it works as desired.

If config.flushInterval is set to 10, then you get:

  • Math.max(0, 10 || 30)
  • Math.max(0, 10)
  • 10

I assume it was done like this to prevent negative values being applied.

@hardillb
Copy link
Contributor

hardillb commented Aug 5, 2024

Hmm, OK. Still think 30 should be the minimum, but won't hold this up.

@hardillb hardillb merged commit eb9c703 into main Aug 5, 2024
5 checks passed
@hardillb hardillb deleted the fix-context-flush branch August 5, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants