Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
deptno committed Apr 27, 2019
2 parents 32df25f + 66c643f commit 07d1d8e
Show file tree
Hide file tree
Showing 3 changed files with 1,097 additions and 1,178 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const tooManyConnsErrors = [
'ER_USER_LIMIT_REACHED',
'ER_OUT_OF_RESOURCES',
'ER_CON_COUNT_ERROR',
'PROTOCOL_CONNECTION_LOST' // if the connection is lost
'PROTOCOL_CONNECTION_LOST', // if the connection is lost
'ETIMEDOUT' // if the connection times out
]

// Init setting values
Expand Down Expand Up @@ -269,7 +270,7 @@ const killZombieConnections = async (timeout) => {
[!isNaN(timeout) ? timeout : 60*15, _cfg.user])

// Kill zombies
for (let i in zombies) {
for (let i = 0; i < zombies.length; i++) {
try {
await query('KILL ?',zombies[i].ID)
onKill(zombies[i]) // fire onKill event
Expand Down Expand Up @@ -321,7 +322,7 @@ const commit = async (queries,rollback) => {
await query('START TRANSACTION')

// Loop through queries
for (let i in queries) {
for (let i = 0; i < queries.length; i++) {
// Execute the queries, pass the rollback as context
let result = await query.apply({rollback},queries[i](results[results.length-1],results))
// Add the result to the main results accumulator
Expand Down
Loading

0 comments on commit 07d1d8e

Please sign in to comment.