mirror of
https://github.com/stronk-dev/RandomChad.git
synced 2025-07-05 02:35:08 +02:00
🐛 make parallel generation more conservative
This commit is contained in:
parent
7252e6ca2d
commit
e3cc979370
@ -125,10 +125,15 @@ async function generateNewOutfitsByAddress( address, network='mainnet' ) {
|
||||
|
||||
const ids = await getTokenIdsOfAddress( address, network )
|
||||
const queue = ids.map( id => function() {
|
||||
return generateNewOutfitFromId( id, network ).then( outfit => ( { id: id, src: outfit } ) ).catch( e => ( { id: id, error: e.message } ) )
|
||||
return generateNewOutfitFromId( id, network ).then( outfit => ( { id: id, src: outfit } ) ).catch( e => {
|
||||
console.error( `Error in generateNewOutfitsByAddress: `, e.message || e )
|
||||
return { id: id, error: e.message }
|
||||
} )
|
||||
} )
|
||||
|
||||
const outfits = await Throttle.all( queue, {
|
||||
maxInProgress: 2,
|
||||
maxInProgress: 1,
|
||||
failFast: false,
|
||||
progressCallback: ( { amountDone } ) => process.env.NODE_ENV == 'development' ? console.log( `Completed ${amountDone}/${queue.length}` ) : false
|
||||
} )
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user