Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit b07c406

Browse files
Slory7lunny
authored andcommitted
fix session_find & session_get getCacher param error (#1131)
* fix session_delete getCacher tablename param error * fix session_find & session_get getCacher param error
1 parent 01dd69d commit b07c406

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

session_find.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (session *Session) find(rowsSlicePtr interface{}, condiBean ...interface{})
176176
}
177177

178178
if session.canCache() {
179-
if cacher := session.engine.getCacher(table.Name); cacher != nil &&
179+
if cacher := session.engine.getCacher(session.statement.TableName()); cacher != nil &&
180180
!session.statement.IsDistinct &&
181181
!session.statement.unscoped {
182182
err = session.cacheFind(sliceElementType, sqlStr, rowsSlicePtr, args...)

session_get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (session *Session) get(bean interface{}) (bool, error) {
5858
table := session.statement.RefTable
5959

6060
if session.canCache() && beanValue.Elem().Kind() == reflect.Struct {
61-
if cacher := session.engine.getCacher(table.Name); cacher != nil &&
61+
if cacher := session.engine.getCacher(session.statement.TableName()); cacher != nil &&
6262
!session.statement.unscoped {
6363
has, err := session.cacheGet(bean, sqlStr, args...)
6464
if err != ErrCacheFailed {

0 commit comments

Comments
 (0)