Are you writing more than 1 time per second per key? That is a hard limit
Are you writing more than 1 time per second per key? That is a hard limit

getWithMetadata function, what are the possible return values for the cacheStatus property. I don't see any info on it here: https://developers.cloudflare.com/kv/api/read-key-value-pairs/#getwithmetadata-methodasync function putKeys(env: Env, pairs: Array<Record<string, string>>): Promise<Response> {
for (const pair of pairs) {
var lastE = null;
for (let i = 0; i < retries; i++) {
try {
await env.KV_NS.put(pair["key"], pair["value"], {
metadata: {
version: "v1",
timestamp: ((Date.now() / 1000) | 0)
}
});
console.log({"message": `Successful to sync key ${pair["key"]}`});
break;
} catch(e) {
lastE = e;
}
}
if (lastE != null) {
console.error({"message": `Failed to sync key ${pair["key"]}`, error: lastE});
}
}
console.log({"message": `Successful synced ${pairs.length} pairs`});
return new Response(null, {});
}const client = new Cloudflare({
apiToken: CLOUDFLARE_API_TOKEN
});
console.log("List all Regional Services regions available for use by this account.");
for await (const regionListResponse of client.addressing.regionalHostnames.regions.list({
account_id: ACCOUNT_ID,
})) {
console.log(regionListResponse);
}
// Got `error: 403 {"result":null,"success":false,"errors":[{"code":1002,"message":"forbidden"}],"messages":[]}`
console.log("List all Regional Hostnames within a zone.");
for await (const regionalHostnameListResponse of client.addressing.regionalHostnames.list({
zone_id: ZONE_ID
})) {
console.log(regionalHostnameListResponse);
}