Skip to content

Commit

Permalink
Fix mysql transaction concurrence connection error, fix #424
Browse files Browse the repository at this point in the history
  • Loading branch information
welefen committed Aug 16, 2016
1 parent d88c551 commit 262489d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/adapter/socket/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ export default class extends Base {
return this.getConnection();
}

return think.await(str, () => {
let awaitKey = str;
if(this.config.forceNewNum){
awaitKey += '_' + this.config.forceNewNum;
}
return think.await(awaitKey, () => {
let deferred = think.defer();
this.connection = mysql.createConnection(config);
this.connection.connect(err => {
Expand Down

0 comments on commit 262489d

Please sign in to comment.