Skip to content

Commit

Permalink
fix_dd
Browse files Browse the repository at this point in the history
  • Loading branch information
YAlorenzo committed May 21, 2024
1 parent 0739812 commit f347b32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/api/cron/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Product from "@/lib/models/product.model";
import { scrapeAmazonProduct } from "@/lib/scraper";
import { generateEmailBody, sendEmail } from "@/lib/nodemailer";

export const maxDuration = 60; // This function can run for a maximum of 300 seconds
export const maxDuration = 60;
export const dynamic = "force-dynamic";
export const revalidate = 0;

Expand Down
1 change: 1 addition & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React from 'react'
import ProductCard from '@/components/ProductCard';

const Home = async () => {

const allProducts = await getAllProducts();

return (
Expand Down
5 changes: 2 additions & 3 deletions lib/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ export async function getProductById(productId: string) {

export async function getAllProducts() {
try {
connectToDB();
await connectToDB();

const products = await Product.find();

console.log(products);

return products;

} catch (error) {
console.log(error);
}
Expand Down

0 comments on commit f347b32

Please sign in to comment.