Open huzhenjie opened 4 years ago
https://github.com/chenshenhai/koa2-note/blob/c667c4fa4b9cf31acd2b76e29a5056b69581ca65/demo/project/server/utils/db-util.js#L17
The code here is reject but not resolve
reject
resolve
return new Promise(( resolve, reject ) => { pool.getConnection(function(err, connection) { if (err) { resolve( err ) // reject( err ) } else { connection.query(sql, values, ( err, rows) => { if ( err ) { reject( err ) } else { resolve( rows ) } connection.release() }) } }) })
https://github.com/chenshenhai/koa2-note/blob/c667c4fa4b9cf31acd2b76e29a5056b69581ca65/demo/project/server/utils/db-util.js#L17
The code here is
reject
but notresolve