From 2e05d47fb78f42a81389f37095d318fe130d7f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Tue, 8 Oct 2024 16:43:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B8=B8=E7=94=A8=E5=86=99?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.go | 11 ++++++++++- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 3e57b4d..24c7310 100644 --- a/client.go +++ b/client.go @@ -9,6 +9,7 @@ package redis import ( "context" + "git.zhangdeman.cn/zhangdeman/consts" "strings" "sync" "time" @@ -209,7 +210,15 @@ func (o *OwnClient) SetLogger(loggerInstance *zap.Logger, extraLogFieldList []st // // Date : 16:22 2024/10/8 func (o *OwnClient) isWriteCommand(command string) bool { - return wrapperOperate.ArrayType([]string{}).Has(strings.ToUpper(command)) >= 0 + return wrapperOperate.ArrayType([]string{ + consts.RedisCommandDel, + consts.RedisCommandSet, + consts.RedisCommandLpush, + consts.RedisCommandRpush, + consts.RedisCommandMSet, + consts.RedisCommandPublish, + consts.RedisCommandPsubScribe, + }).Has(strings.ToUpper(command)) >= 0 } // newClient 获取客户端连接 diff --git a/go.mod b/go.mod index 3fcba66..9e92595 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( ) require ( - git.zhangdeman.cn/zhangdeman/consts v0.0.0-20240924065029-c865046cd9e7 // indirect + git.zhangdeman.cn/zhangdeman/consts v0.0.0-20241008084126-0b1c661317ee // indirect git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20240311030808-e2a2e6a3c211 // indirect git.zhangdeman.cn/zhangdeman/op_type v0.0.0-20240122104027-4928421213c0 // indirect git.zhangdeman.cn/zhangdeman/serialize v0.0.0-20240618035451-8d48a6bd39dd // indirect diff --git a/go.sum b/go.sum index 4a98133..1a44b7b 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ git.zhangdeman.cn/zhangdeman/consts v0.0.0-20240612081722-31c64d4d4ce7 h1:QR8vMX git.zhangdeman.cn/zhangdeman/consts v0.0.0-20240612081722-31c64d4d4ce7/go.mod h1:IXXaZkb7vGzGnGM5RRWrASAuwrVSNxuoe0DmeXx5g6k= git.zhangdeman.cn/zhangdeman/consts v0.0.0-20240924065029-c865046cd9e7 h1:tyCPCMK+68PZ0axZylQHitMVp1d5mzNr9/YqMHXqo+A= git.zhangdeman.cn/zhangdeman/consts v0.0.0-20240924065029-c865046cd9e7/go.mod h1:IXXaZkb7vGzGnGM5RRWrASAuwrVSNxuoe0DmeXx5g6k= +git.zhangdeman.cn/zhangdeman/consts v0.0.0-20241008084126-0b1c661317ee h1:4nuaCr5GQcx4z9/xWeEnjmLVV6J0j+QT68+AUKI9dFc= +git.zhangdeman.cn/zhangdeman/consts v0.0.0-20241008084126-0b1c661317ee/go.mod h1:IXXaZkb7vGzGnGM5RRWrASAuwrVSNxuoe0DmeXx5g6k= git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20240311030808-e2a2e6a3c211 h1:I/wOsRpCSRkU9vo1u703slQsmK0wnNeZzsWQOGtIAG0= git.zhangdeman.cn/zhangdeman/easymap v0.0.0-20240311030808-e2a2e6a3c211/go.mod h1:SrtvrQRdzt+8KfYzvosH++gWxo2ShPTzR1m3VQ6uX7U= git.zhangdeman.cn/zhangdeman/op_type v0.0.0-20240122104027-4928421213c0 h1:gUDlQMuJ4xNfP2Abl1Msmpa3fASLWYkNlqDFF/6GN0Y=