hardikverma22 / travel-planner-ai

AI travel planner leveraging Next.js, Convex, Clerk, Resend and OpenAI APIs for natural language interactions
https://travelplannerai.online
31 stars 8 forks source link

Store Weather details and update it periodically #4

Open hardikverma22 opened 2 months ago

hardikverma22 commented 2 months ago

Instead of triggering the weather API each time a user visit a plan, trigger the API call only if the delay is 1 hour at least and show last updated time also. Lets say user visits a plan first time, the server should call the weather api and return the updated weather. Now if you visit that page again and again, last updated should be checked and if it more than one hour from current time, the api should trigger again. until then one hour stale data should be shown.