mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 17:45:59 +08:00
check.go
This commit is contained in:
@@ -4,6 +4,9 @@ import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/proto/sdkws"
|
||||
"Open_IM/pkg/utils"
|
||||
"github.com/go-redis/redis/v8"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func isMessageHasReadEnabled(msgData *sdkws.MsgData) bool {
|
||||
@@ -23,3 +26,12 @@ func isMessageHasReadEnabled(msgData *sdkws.MsgData) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func IsNotFound(err error) bool {
|
||||
switch utils.Unwrap(err) {
|
||||
case redis.Nil, gorm.ErrRecordNotFound:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user