Skip to content

Commit

Permalink
Add debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak committed Mar 2, 2024
1 parent 3bda393 commit d967b70
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,11 @@ async function listWorkerRoutes(token: string, account: string): Promise<any> {
debug(`Fetching account worker routes`);
const domainRoutes = async (domain: any) =>
listWorkerDomainRoutes(token, domain);
debug(`Fetching worker domains`);
const domains = await listWorkerDomains(token, account);
const routes = await Promise.all(
domains.map((x: any) => x.zone_id).map(domainRoutes)
);
const domainIds = unique(domains, 'zone_id').map((x: any) => x.zone_id);
debug(`Found domain ids ${JSON.stringify(domainIds)}`);
const routes = await Promise.all(domainIds.map(domainRoutes));
if (routes) {
routes.flat().map((x) => {
debug(`Found route ${x.id}: ${x.pattern}`);
Expand Down

0 comments on commit d967b70

Please sign in to comment.