weeklyMarketsEmails: send different markets to different users
This commit is contained in:
parent
b476a7e3f8
commit
1c73d21925
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user