-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SyntaxError: Unexpected token #111
Comments
I can reproduce this:
This is a rate limit from Cloudflare, which shouldn't happen unless fast mode is used:
Very unusual. I guess this could be fixed by aggressively sleeping between requests, but that is a stopgap solution since the real problem lies within a misconfiguration on Cloudflare's side. |
Yeah it's better if Cloudflare's aware of this problem. While we're waiting for a stable fix from their side, for anyone who's looking for a temporary fix, I've tested updating filters from OISD Big to AdGuard DNS filter and didn't trigger the rate limit by modifying the /**
* Creates Zero Trust lists sequentially.
* @param {string[]} items The domains.
*/
export const createZeroTrustListsOneByOne = async (items) => {
let totalListNumber = Math.ceil(items.length / LIST_ITEM_SIZE);
for (let i = 0, listNumber = 1; i < items.length; i += LIST_ITEM_SIZE) {
const chunk = items
.slice(i, i + LIST_ITEM_SIZE)
.map((item) => ({ value: item }));
const listName = `CGPS List - Chunk ${listNumber}`;
try {
await createZeroTrustList(listName, chunk);
totalListNumber--;
listNumber++;
console.log(`Created "${listName}" list - ${totalListNumber} left`);
await new Promise((r) => setTimeout(r, 3000)); // sleep for 3 secs
} catch (err) {
console.error(`Could not create "${listName}" - ${err.toString()}`);
throw err;
}
}
};
/**
* Deletes Zero Trust lists sequentially.
* @param {Object[]} lists The lists to be deleted.
* @param {number} lists[].id The ID of a list.
* @param {string} lists[].name The name of a list.
*/
export const deleteZeroTrustListsOneByOne = async (lists) => {
let totalListNumber = lists.length;
for (const { id, name } of lists) {
try {
await deleteZeroTrustList(id);
totalListNumber--;
console.log(`Deleted ${name} list - ${totalListNumber} left`);
await new Promise((r) => setTimeout(r, 3000)); // sleep for 3 secs
} catch (err) {
console.error(`Could not delete ${name} - ${err.toString()}`);
throw err;
}
}
}; I guess it's good to leave this issue open for a while at least until Cloudflare's implemented a fix from their side. |
Got this error today.
Everything worked fine several days ago.
The text was updated successfully, but these errors were encountered: