File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1870,7 +1870,8 @@ MongoDB.prototype.autoupdate = function(models, cb) {
18701870
18711871 const enableGeoIndexing = this . settings . enableGeoIndexing === true ;
18721872
1873- async . each (
1873+ // Make it serial as multiple models might map to the same collection
1874+ async . eachSeries (
18741875 models ,
18751876 function ( modelName , modelCallback ) {
18761877 const indexes = self . _models [ modelName ] . settings . indexes || [ ] ;
@@ -1954,7 +1955,8 @@ MongoDB.prototype.autoupdate = function(models, cb) {
19541955 debug ( 'create indexes: ' , indexList ) ;
19551956 }
19561957
1957- async . each (
1958+ // Make it serial as multiple indexes may try to create the same collection at once
1959+ async . eachSeries (
19581960 indexList ,
19591961 function ( index , indexCallback ) {
19601962 if ( self . debug ) {
You can’t perform that action at this time.
0 commit comments