I’m investigating Redwood for some small and mid-sized projects, both of which need to fill their databases regularly (one is a local network crawler, one caches gitlab information).
For that I would like to use recurring tasks, but I don’t want to setup Celery or Quirrel. Using hosted services is also out of the question since theses projects need to run in a local-only environment.
Two options I would like to try are:
- Run some code on server startup that starts a background task (that’s what I did in my Blitz.js tests)
- Create a second entrypoint in the api package that has access to the db as well, but can be put in crontab to be run regularly
I would honestly prefer the first option because it allows me to use sqlite in very small deployments (which wouldn’t work so well when the db needs to be accessed from multiple processes)
I don’t know how to do either of those things in Redwood, and haven’t found any documentation on it yet.
I know Redwood is designed to be run on “serverless” infrastructure and thus running a persistent server on startup is kind of against the design, but it’s more or less necessitated by my usecase (or by the need to be operationally simple), and I really like many other aspects of Redwood.
I’m looking forward to any suggestions