Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop() can throw undefined errors #199

Open
mattbishop opened this issue Aug 7, 2023 · 1 comment
Open

stop() can throw undefined errors #199

mattbishop opened this issue Aug 7, 2023 · 1 comment

Comments

@mattbishop
Copy link

mattbishop commented Aug 7, 2023

I am closing a toad scheduler instance using a shutdown hook and I often see this error when the hook calls stop():

Cannot read properties of undefined (reading 'engines')
    err: {
      "type": "TypeError",
      "message": "Cannot read properties of undefined (reading 'engines')",
      "stack":
          TypeError: Cannot read properties of undefined (reading 'engines')
              at stop (/Users/matt/Projects/monorepo/node_modules/toad-scheduler/dist/lib/toadScheduler.js:40:49)
              at fn (file:///Users/matt/Projects/monorepo/admin-api/src/shutdown.ts:8:36)
              at async run (/Users/matt/monorepo/node_modules/close-with-grace/index.js:92:19)
    }

Not sure what is happening exactly, but a bit more defensiveness with checking for engines !== undefined would help the close() function.

@kibertoad
Copy link
Owner

thank you for the report! will take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants