Skip to content

Commit 4b6043b

Browse files
committed
补充getById方法__isSafeTransaction判断
1 parent 44367ac commit 4b6043b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/MysqlCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class MysqlCache<Scheme> extends MysqlNative<Scheme> {
6565
}
6666

6767
async getById(id: string, pick = this.columns, trx?: CoaMysql.Transaction, ms = this.ms, force = false) {
68-
const result = trx ? await super.getById(id, this.columns, trx) : await this.redisCache.warp(this.getCacheNsp('id'), id, async () => await super.getById(id, this.columns, trx), ms, force)
68+
const result = trx?.__isSafeTransaction ? await super.getById(id, this.columns, trx) : await this.redisCache.warp(this.getCacheNsp('id'), id, async () => await super.getById(id, this.columns, trx), ms, force)
6969
return this.pickResult(result, pick)
7070
}
7171

0 commit comments

Comments
 (0)