Mepps has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/397901 )
Change subject: End connections after query
......................................................................
End connections after query
Change-Id: Iedacd416ab35c4ad3de397cff3bc11cbc7e7a77c
---
M persistence.js
1 file changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash
refs/changes/01/397901/1
diff --git a/persistence.js b/persistence.js
index 188a9cf..12a8a5d 100644
--- a/persistence.js
+++ b/persistence.js
@@ -32,7 +32,7 @@
values.push( board.id );
values.push( i );
}
- return connection.query( insertWidgets + placeholders, values );
+ return connection.query( insertWidgets + placeholders, values ).then(
connection.end() );
}
module.exports = {
@@ -96,7 +96,9 @@
return;
}
user.defaultBoard = dbResults[ 0 ][ 2 ][ 0 ].id;
- return connection.query( insertBigEnglish, [
userId ] );
+ var result = connection.query(
insertBigEnglish, [ userId ] )
+ .then( connection.end() );
+ return result;
} );
},
/**
@@ -125,6 +127,7 @@
}
return connection.query( insert, insertParams ).then( function
( dbResults ) {
instance.id = dbResults[ 0 ].insertId;
+ connection.end();
} );
},
/**
@@ -140,6 +143,7 @@
return connection.query( select, [ instanceId, userId ] )
.then( function ( dbResults ) {
var result = dbResults[ 0 ][ 0 ];
+ connection.end();
if ( result.owner_id ) {
return {
id: instanceId,
@@ -187,6 +191,7 @@
previewPath: rows[ i
].preview_path
};
}
+ connection.end();
return result;
} );
},
@@ -286,6 +291,7 @@
configuration: JSON.parse(
rows[ i ].configuration )
};
}
+ connection.end();
return board;
} );
},
@@ -315,6 +321,7 @@
isShared: rows[ i ].is_shared
=== 1
};
}
+ connection.end();
return result;
} );
},
@@ -341,7 +348,9 @@
previewPath: rows[ i
].preview_path
};
}
+ connection.end();
return result;
} );
}
+
};
--
To view, visit https://gerrit.wikimedia.org/r/397901
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iedacd416ab35c4ad3de397cff3bc11cbc7e7a77c
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Mepps <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits