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

add limiter for no values to upsert #13650

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/bridges/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ func (c *Cache) doBulkUpsert() {
values := maps.Values(c.bridgeLastValueCache)
c.mu.RUnlock()

if len(values) == 0 {
return
}

if err := c.ORM.BulkUpsertBridgeResponse(context.Background(), values); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope, but we can do better than Background here. Let's circle back to upgrade the stop chan to a StopChan in order to spawn a Context to pass here (or from the caller).

c.lggr.Warnf("bulk upsert of bridge responses failed: %s", err.Error())
}
Expand Down
Loading