diff --git a/lib/staticPathTimeout.js b/lib/staticPathTimeout.js index df39762f..06176a60 100644 --- a/lib/staticPathTimeout.js +++ b/lib/staticPathTimeout.js @@ -13,7 +13,7 @@ export async function getPostsWithRetry({maxRetries = 3, postType="article"}) { postType, process.env.NODE_ENV || process.env.NEXT_PUBLIC_HOME_URL.indexOf("localhost") > -1 - ? 20 + ? TOTAL_STATIC_POSTS : TOTAL_STATIC_POSTS ), staticPathTimeout(26000), // Set your desired timeout in milliseconds diff --git a/pages/post/[slug].js b/pages/post/[slug].js index 83bc16ff..61598f4b 100644 --- a/pages/post/[slug].js +++ b/pages/post/[slug].js @@ -447,9 +447,10 @@ export async function getStaticProps({ params, preview = null, locale }) { } export async function getStaticPaths({ locales }) { - - - const allPosts=await getPostsWithRetry({maxRetries: 3, postType:"article"}) + const allPosts = await getPostsWithRetry({ + maxRetries: 4, + postType: "article", + }); return { paths: diff --git a/pages/toolbox/[slug].js b/pages/toolbox/[slug].js index c0027942..6c6289b5 100644 --- a/pages/toolbox/[slug].js +++ b/pages/toolbox/[slug].js @@ -51,7 +51,7 @@ import buildToolboxGallery, { } from "@/lib/utils/buildGallery"; import { formatAllTools } from "@/lib/utils/formatToolContent"; import ToolIconCard from "@/components/v4/card/ToolIconCard"; -import { staticPathTimeout } from "@/lib/staticPathTimeout"; +import { getPostsWithRetry, staticPathTimeout } from "@/lib/staticPathTimeout"; const ToolContent = ({ post, @@ -655,7 +655,11 @@ export async function getStaticProps({ params, preview = null, locale }) { } export async function getStaticPaths() { - const allPosts = await getAllPostsWithSlug("tool", TOTAL_STATIC_POSTS); + // const allPosts = await getAllPostsWithSlug("tool", TOTAL_STATIC_POSTS); + const allPosts = await getPostsWithRetry({ + maxRetries: 4, + postType: "tool", + }); return { paths: