Skip to content

Commit

Permalink
Revert "don't wait revalidation"
Browse files Browse the repository at this point in the history
This reverts commit 5075d37.
  • Loading branch information
pmi committed Sep 18, 2023
1 parent 5075d37 commit 4ded5cd
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/pages/api/revalidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
}
return revalidatePath(res, cp);
});
Promise.all(promises).then(() => {
console.info(`Done revalidating everything`);
}).catch((err) => {
console.info(`Revalidation error: ` + err);
});
await Promise.all(promises);
console.info(`Done revalidating everything`);
} else {
revalidatePath(res, path).then(() => {
console.info(`Revalidated [${path}]`);
}).catch((err) => {
console.info(`Revalidation error: ` + err);
});
await revalidatePath(res, path);
console.info(`Revalidated [${path}]`);
}
// Return 200 after everything's revalidated
res.status(200).json({message: 'Revalidation started'});
Expand Down

1 comment on commit 4ded5cd

@vercel
Copy link

@vercel vercel bot commented on 4ded5cd 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.vercel.app
nextjs-enonic-demo-git-master-pmi1k.vercel.app
nextjs-enonic-demo-pmi1k.vercel.app

Please sign in to comment.