I have an array of URLs, and I would like fetch requests to be evenly distributed among them.
Is this the right approach?
// randomly get one URL with equal probability
var idx = Math.floor(Math.random() * ArrURLs.length);
var randomResponse = await fetch(ArrURLs[idx]);
Aucun commentaire:
Enregistrer un commentaire