Skip to content

Commit

Permalink
feat: Add env var WORLDS_LIVE_DATA
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Nov 19, 2024
1 parent c8b8c8e commit 9db1cae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/entities/World/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import env from "decentraland-gatsby/dist/utils/env"

import { AggregatePlaceAttributes } from "../Place/types"
import { WorldLiveDataProps, WorldLivePerWorldProps } from "./types"

Expand Down Expand Up @@ -28,11 +30,13 @@ export function worldsWithUserCount(
export const fetchWorldsLiveDataAndUpdateCache = async (): Promise<void> => {
try {
const liveFetch = await fetch(
"https://worlds-content-server.decentraland.org/live-data"
env(
"WORLDS_LIVE_DATA",
"https://worlds-content-server.decentraland.org/live-data"
)
)
const liveData = await liveFetch.json()
memory = liveData.data
console.log(memory)
} catch (error) {
memory = DEFAULT_WORLD_LIVE_DATA
}
Expand Down

0 comments on commit 9db1cae

Please sign in to comment.