Skip to content

Commit e2a00fc

Browse files
committed
修改冗余push
1 parent 069a2dd commit e2a00fc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/services/MysqlCache.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,14 @@ export class MysqlCache<Scheme> extends MysqlNative<Scheme> {
153153
}
154154

155155
async deleteCache(ids: string[], dataList: Array<CoaMysql.SafePartial<Scheme>>, trx?: CoaMysql.Transaction) {
156+
const deleteIds = [] as CoaRedis.CacheDelete[]
156157
if ((trx as any)?.__isSafeTransaction) {
157158
(trx as any)?.clearCacheNsps.push([this.getCacheNsp('id'), ids]);
158159
(trx as any)?.clearCacheNsps.push([this.getCacheNsp('data'), []])
160+
} else {
161+
deleteIds.push([this.getCacheNsp('id'), ids])
162+
deleteIds.push([this.getCacheNsp('data'), []])
159163
}
160-
const deleteIds = [] as CoaRedis.CacheDelete[]
161-
deleteIds.push([this.getCacheNsp('id'), ids])
162-
deleteIds.push([this.getCacheNsp('data'), []])
163164
_.forEach(this.caches, (items, name) => {
164165
// name可能为index,count,或自定义
165166
items.forEach(item => {

0 commit comments

Comments
 (0)