From d33d723eeeae24171a2defddab98a3c37976ae7f Mon Sep 17 00:00:00 2001 From: jaxliu Date: Thu, 5 Oct 2023 01:57:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BD=93=E8=AE=BE=E7=BD=AE=20Hash=20Key?= =?UTF-8?q?=20fields=20=E4=B8=BA=E5=A4=9A=E4=B8=AA=E6=97=B6=EF=BC=8CHSet?= =?UTF-8?q?=20=E5=91=BD=E4=BB=A4=E4=BC=9A=E6=8A=A5=E9=94=99=EF=BC=8C?= =?UTF-8?q?=E8=BF=99=E9=87=8C=E4=BD=BF=E7=94=A8=20HMSet=20=E5=8D=B3?= =?UTF-8?q?=E5=8F=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/services/connection_service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/services/connection_service.go b/backend/services/connection_service.go index efff948..06c3943 100644 --- a/backend/services/connection_service.go +++ b/backend/services/connection_service.go @@ -663,7 +663,7 @@ func (c *connectionService) SetKeyValue(connName string, db int, key, keyType st return } else { if len(strs) > 1 { - err = rdb.HSet(ctx, key, strs).Err() + err = rdb.HMSet(ctx, key, strs).Err() if err == nil && expiration > 0 { rdb.Expire(ctx, key, expiration) } @@ -795,7 +795,7 @@ func (c *connectionService) AddHashField(connName string, db int, key string, ac } default: // overwrite duplicated fields - _, err = rdb.HSet(ctx, key, fieldItems...).Result() + _, err = rdb.HMSet(ctx, key, fieldItems...).Result() for i := 0; i < len(fieldItems); i += 2 { updated[fieldItems[i].(string)] = fieldItems[i+1] }