jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/397614 )

Change subject: End connections after query
......................................................................


End connections after query

Change-Id: Ic2ad2f4df9975baa5cd5b02634485568f844d149
---
M persistence.js
1 file changed, 12 insertions(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Ejegg: Looks good to me, approved



diff --git a/persistence.js b/persistence.js
index 188a9cf..6398d58 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;
                        } );
        },
@@ -237,7 +242,7 @@
                                board.id = dbResults[ 0 ].insertId;
                        } )
                        .then( function () {
-                               return insertWidgetList( board, connection );
+                               return insertWidgetList( board, connection 
).then( connection.end() );
                        } );
        },
        /**
@@ -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/397614
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic2ad2f4df9975baa5cd5b02634485568f844d149
Gerrit-PatchSet: 7
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Mepps <me...@wikimedia.org>
Gerrit-Reviewer: Ejegg <ej...@ejegg.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to