use mapAsync for all cases in mapAsyncDialects

This commit is contained in:
Marc-Roig 2023-01-31 11:57:32 +01:00
parent cd8429c3c7
commit 9d865b7b11

View File

@ -27,12 +27,12 @@ const mapAsync = curry(pMap);
*
* @type { import('./async').MapAsync }
*/
const mapAsyncDialects = async (array, func) => {
const mapAsyncDialects = async (array, func, options = {}) => {
switch (strapi.db.dialect.client) {
case 'mysql':
return mapAsync(array, func);
return mapAsync(array, func, { concurrency: 1 });
default:
return Promise.all(array.map(func));
return mapAsync(array, func, options);
}
};