mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 06:35:47 +00:00
use mapAsync for all cases in mapAsyncDialects
This commit is contained in:
parent
cd8429c3c7
commit
9d865b7b11
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user