Skip to content

Commit 50e02e1

Browse files
authored
Update status badges for Anaconda.org (#2278)
1 parent 8399abe commit 50e02e1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/StatusDashboard/repos_and_bots.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ function Image({ alt, link, children }) {
5757
}
5858

5959
function CDNStatus() {
60-
const [{ minutes, status }, setState] = useState({ minutes: 0, status: "…" });
60+
const [{ minutes, status }, setState] = useState({ minutes: "…", status: "…" });
6161
useEffect(() => {
6262
void (async () => {
6363
try {
64-
const response = await (await fetch(urls.repos.cdn.api)).text();
65-
const updated = new Date(response.trim()).getTime();
64+
const response = await (await fetch(`${urls.repos.cdn.api}?bustcache=${Date.now()}`)).json();
65+
const updated = new Date(response.timestamp.iso8601).getTime();
6666
const delta = (new Date()).getTime() - updated;
6767
const status = delta < OPERATIONAL_WINDOW ? "operational" :
6868
delta < DEGRADED_WINDOW ? "degraded" : "major outage";

src/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ export const urls = {
126126
},
127127
],
128128
cdn: {
129-
api: "https://s3.amazonaws.com/conda-static.anaconda.org/conda-forge/last-updated",
130-
link: "https://conda-static.anaconda.org/conda-forge/rss.xml",
129+
api: "https://conda.anaconda.org/conda-forge/last-updated.json",
130+
link: "https://conda.anaconda.org/conda-forge/rss.xml",
131131
},
132132
services: {
133133
api: "https://conda-forge.herokuapp.com/alive",

0 commit comments

Comments
 (0)