nestjs-graphile-worker icon indicating copy to clipboard operation
nestjs-graphile-worker copied to clipboard

Nest onApplicationShutdown hook

Open maximn opened this issue 1 year ago • 3 comments

Is there a reason there's not integration with onApplicationShutdown hook to stop the runner? @madeindjs And also onApplicationBootstrap is probably better than calling the .run() method manually

maximn avatar Mar 20 '25 14:03 maximn

There are no particular reason for this. Feel free to create a Pull Request about this if you need this feature and I'll publish it on NPM.

However, this is a breaking change and It needs to be a new major version (like v1.0.0).

madeindjs avatar Mar 20 '25 20:03 madeindjs

Sure, actually thinking about this agian, I'm not sure if it's necessary because might be that graphile is already subscibe to shutdown events of nodej.

I've tried to run the sample app from this repo but it didn't work for me. First you're not expsing the nodejs app port, but after exposed it I'm still having issues

backend-1   | Error: Cannot find module '/usr/src/app/sample/dist/main'
backend-1   |     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
backend-1   |     at Function.Module._load (node:internal/modules/cjs/loader:873:27)
backend-1   |     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
backend-1   |     at node:internal/main/run_main_module:22:47

Could you have a look and maybe add more detailed instruction in the readme on how to run/debug it?

maximn avatar Mar 21 '25 10:03 maximn

Indeed, I think I miss a build command or something. I'll try to look at it this week. Thanks for the report @maximn

madeindjs avatar Apr 07 '25 11:04 madeindjs