Replies: 1 comment
-
Where does your cron job read the new data from? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a defined set of data, that does not update very often. For that reason, I decided to just store it as
data.json
file, and import ithooks.server.ts
and assign it tolocals.data
.if it ever needed an update, i'll just update the
data.json
file, and redeploy to vercel. So far, this works fine.However, I thought, instead of the static
data.json
file, maybe I can have a cron job that checks for updates once a day, if any, it'll just update a reactive store that's assigned into locals so that it'll always have latest data; avoiding making lots of calls to api/database.how can I do that?
I tried doing it, but the data always stales, and never updates, defeating the purpose of having a "reactive" store.
Beta Was this translation helpful? Give feedback.
All reactions