File tree 1 file changed +4
-2
lines changed
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) {
1870
1870
1871
1871
const enableGeoIndexing = this . settings . enableGeoIndexing === true ;
1872
1872
1873
- async . each (
1873
+ // Make it serial as multiple models might map to the same collection
1874
+ async . eachSeries (
1874
1875
models ,
1875
1876
function ( modelName , modelCallback ) {
1876
1877
const indexes = self . _models [ modelName ] . settings . indexes || [ ] ;
@@ -1954,7 +1955,8 @@ MongoDB.prototype.autoupdate = function(models, cb) {
1954
1955
debug ( 'create indexes: ' , indexList ) ;
1955
1956
}
1956
1957
1957
- async . each (
1958
+ // Make it serial as multiple indexes may try to create the same collection at once
1959
+ async . eachSeries (
1958
1960
indexList ,
1959
1961
function ( index , indexCallback ) {
1960
1962
if ( self . debug ) {
You can’t perform that action at this time.
0 commit comments