weeklyMarketsEmails: send different markets to different users

This commit is contained in:
mantikoros 2022-08-23 00:27:07 -05:00
parent b476a7e3f8
commit 1c73d21925

View File

@ -92,9 +92,11 @@ async function sendTrendingMarketsEmailsToAllUsers() {
}
}
const fiveMinutes = 5 * 60 * 1000
const seed = Math.round(Date.now() / fiveMinutes).toString()
const rng = createRNG(seed)
function chooseRandomSubset(contracts: Contract[], count: number) {
const fiveMinutes = 5 * 60 * 1000
const seed = Math.round(Date.now() / fiveMinutes).toString()
shuffle(contracts, createRNG(seed))
shuffle(contracts, rng)
return contracts.slice(0, count)
}