File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change 11import { echo } from 'coa-echo'
22import { CoaError } from 'coa-error'
3- import { secure } from 'coa-secure'
43import { MysqlCache } from '../services/MysqlCache'
54import { CoaMysql } from '../typings'
65import { Knex } from './Knex'
@@ -33,11 +32,9 @@ export class MysqlBin {
3332 }
3433
3534 async safeTransaction < T > ( handler : ( trx : CoaMysql . Transaction ) => Promise < T > ) : Promise < T > {
36-
3735 let cacheTasks = [ ] as Array < { model : MysqlCache < any > , ids : string [ ] , dataList : any [ ] } >
3836
3937 const result = await this . io . transaction ( async ( trx : any ) => {
40- trx . id ||= secure . id25 ( `${ Date . now ( ) } -${ Math . floor ( Math . random ( ) * 1e6 ) . toString ( ) . padStart ( 6 , '0' ) } ` )
4138 // 收集事务更新缓存数据
4239 trx . trxUpdateCacheTaskList = async ( model : MysqlCache < any > , ids : string [ ] , dataList : any [ ] ) => {
4340 cacheTasks . push ( { model, ids, dataList } )
Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ const User = new (class extends MysqlCache<UserScheme> {
6969 title : '用户表' , // 表的备注名称
7070 scheme : userScheme , // 表的默认结构
7171 pick : [ 'userId' , 'name' ] , // 查询列表时显示的字段信息
72- caches : { index : [ 'name' ] , count : [ 'userId' , 'name' ] }
72+ caches : { index : [ 'name' ] , count : [ 'userId' , 'name' ] } ,
73+
7374 } ,
7475 mysqlBin ,
7576 redisCache ,
You can’t perform that action at this time.
0 commit comments