Skip to content

Commit

Permalink
debugging revalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
pmi committed Sep 18, 2023
1 parent c5953f2 commit 3e10504
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/pages/api/revalidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
if (!path) {
console.info('Started revalidating everything...');
const projectId = req.headers[PROJECT_ID_HEADER] as string | undefined;
console.info('revalidation projectId: ' + projectId);
const config = getLocaleProjectConfigById(projectId);
console.info('revalidation config: ' + JSON.stringify(config, null, 2));
const paths = await fetchContentPathsForLocale('\${site}/', config);
console.info('revalidation paths length: ' + paths?.length);
const promises = paths.map((item: ContentPathItem) => {
const cp = item.params.contentPath;
if (cp[0] === "") {
Expand All @@ -43,6 +46,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<

async function revalidatePath(res: any, path: string[] | string) {
let normalPath;
console.info('revalidation path: ' + path);
if (typeof path === 'string') {
normalPath = path.charAt(0) !== '/' ? '/' + path : path;
} else {
Expand Down

1 comment on commit 3e10504

@vercel
Copy link

@vercel vercel bot commented on 3e10504 Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextjs-enonic-demo – ./

nextjs-enonic-demo-git-master-pmi1k.vercel.app
nextjs-enonic-demo.vercel.app
nextjs-enonic-demo-pmi1k.vercel.app

Please sign in to comment.