Skip to content

Commit

Permalink
timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
GraemeFulton committed Apr 19, 2024
1 parent 92ac4a2 commit d21e101
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/staticPathTimeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions pages/post/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions pages/toolbox/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d21e101

Please sign in to comment.