I have question regarding Cloudflare Snippets. Docs says that 2 subrequest are allowed but: ``` asyn

I have question regarding Cloudflare Snippets. Docs says that 2 subrequest are allowed but:
async function getNTPTime() {
const ntpApiUrl = 'http://worldtimeapi.org/api/timezone/Etc/UTC';

try {
const ntpResponse = await fetch(ntpApiUrl);

if (!ntpResponse.ok) {
throw new Error(`NTP server responded with status ${ntpResponse.status}`);
}

const ntpData = await ntpResponse.json();
const epochTimeInMs = ntpData.unixtime * 1000;

return epochTimeInMs;
} catch (error) {
throw new Error("Failed to fetch NTP time: " + error.message);
}
}
async function getNTPTime() {
const ntpApiUrl = 'http://worldtimeapi.org/api/timezone/Etc/UTC';

try {
const ntpResponse = await fetch(ntpApiUrl);

if (!ntpResponse.ok) {
throw new Error(`NTP server responded with status ${ntpResponse.status}`);
}

const ntpData = await ntpResponse.json();
const epochTimeInMs = ntpData.unixtime * 1000;

return epochTimeInMs;
} catch (error) {
throw new Error("Failed to fetch NTP time: " + error.message);
}
}
This REST request return Error: Failed to fetch NTP time: NTP server responded with status 520 What could be the cause?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?