File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
apps/site/next-data/generators Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 33 GITHUB_GRAPHQL_URL ,
44 GITHUB_API_KEY ,
55} from '#site/next.constants.mjs' ;
6+ import { shuffle } from '#site/util/array' ;
67import { fetchWithRetry } from '#site/util/fetch' ;
78
89/**
@@ -200,12 +201,17 @@ const graphql = async (query, variables = {}) => {
200201 * @returns {Promise<Array<import('#site/types/supporters').OpenCollectiveSupporter | import('#site/types/supporters').GithubSponsorSupporter>> } Array of supporters
201202 */
202203async function sponsorsData ( ) {
204+ const seconds = 300 ; // Change every 5 minutes
205+ const seed = Math . floor ( Date . now ( ) / ( seconds * 1000 ) ) ;
206+
203207 const sponsors = await Promise . all ( [
204208 fetchGithubSponsorsData ( ) ,
205209 fetchOpenCollectiveData ( ) ,
206210 ] ) ;
207211
208- return sponsors . flat ( ) ;
212+ const shuffled = await shuffle ( sponsors . flat ( ) , seed ) ;
213+
214+ return shuffled ;
209215}
210216
211217export default sponsorsData ;
You can’t perform that action at this time.
0 commit comments