So graphile-worker
seems to work great.
I had to create a new script
in redwood and now I can start an additional docker container with rw exec worker
to run that worker.
Also needed to copy the scripts folder, which I didn’t do before
My worker.ts looks like this:
Implementing the tasks is pretty straight forward and I seem to be able to use services and database stuff without a problem.
Things I’m not happy with, but seem non breaking:
- Importing stuff to a task in the script folder seems weird. As vscode doesn’t seem to figure out automatically, where to import stuff from.
- I’m not fully sure, where packages get pulled from. It seems to work fine to import them in the
package.json
in the api folder. But it seems a bit out of control, it would be nice, if thescripts
folder had it’s ownpackage.json