Skip to content

Commit

Permalink
Update status badges for Anaconda.org (#2278)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp authored Aug 28, 2024
1 parent 8399abe commit 50e02e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/StatusDashboard/repos_and_bots.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ function Image({ alt, link, children }) {
}

function CDNStatus() {
const [{ minutes, status }, setState] = useState({ minutes: 0, status: "…" });
const [{ minutes, status }, setState] = useState({ minutes: "…", status: "…" });
useEffect(() => {
void (async () => {
try {
const response = await (await fetch(urls.repos.cdn.api)).text();
const updated = new Date(response.trim()).getTime();
const response = await (await fetch(`${urls.repos.cdn.api}?bustcache=${Date.now()}`)).json();
const updated = new Date(response.timestamp.iso8601).getTime();
const delta = (new Date()).getTime() - updated;
const status = delta < OPERATIONAL_WINDOW ? "operational" :
delta < DEGRADED_WINDOW ? "degraded" : "major outage";
Expand Down
4 changes: 2 additions & 2 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export const urls = {
},
],
cdn: {
api: "https://s3.amazonaws.com/conda-static.anaconda.org/conda-forge/last-updated",
link: "https://conda-static.anaconda.org/conda-forge/rss.xml",
api: "https://conda.anaconda.org/conda-forge/last-updated.json",
link: "https://conda.anaconda.org/conda-forge/rss.xml",
},
services: {
api: "https://conda-forge.herokuapp.com/alive",
Expand Down

0 comments on commit 50e02e1

Please sign in to comment.