From 03be29c0c65c178c846cca3a30bf572223b9640b Mon Sep 17 00:00:00 2001 From: Awbrey Hughlett Date: Fri, 21 Jun 2024 09:10:01 -0500 Subject: [PATCH] add limiter for no values to upsert --- core/bridges/cache.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/bridges/cache.go b/core/bridges/cache.go index eb45d4ff624..b65a1667519 100644 --- a/core/bridges/cache.go +++ b/core/bridges/cache.go @@ -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 { c.lggr.Warnf("bulk upsert of bridge responses failed: %s", err.Error()) }