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: revert event batching #197

Merged
merged 1 commit into from
Apr 30, 2024
Merged

fix: revert event batching #197

merged 1 commit into from
Apr 30, 2024

Conversation

kaushalkapasi
Copy link
Collaborator

  • reverts event batching, events will be flushed in a single request every flush interval

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kaushalkapasi - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines -303 to -312
let totalEventsCount = events.count
var startIndex = 0
var endIndex = min(self.maxBatchSize, totalEventsCount)

while startIndex < totalEventsCount {
let batchEvents = Array(events[startIndex..<endIndex])

let requestBody: [String: Any] = [
"events": batchEvents,
"user": user
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (performance): Removal of batching logic could impact performance or functionality.

Consider the implications of sending all events in a single request, such as potential issues with large payloads or server limitations.

@kaushalkapasi kaushalkapasi merged commit 672a5a5 into main Apr 30, 2024
10 checks passed
@kaushalkapasi kaushalkapasi deleted the fix-revert-event-batching branch April 30, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants