Health checks cannot be performed as commands #4666
Unanswered
trulysinclair
asked this question in
Help
Replies: 3 comments
-
I'd like to add that when running the server as normal and using a |
Beta Was this translation helpful? Give feedback.
0 replies
-
Your code does not include how do you import the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you, this is working fine now export default class HealthCheckReport extends BaseCommand {
static commandName = 'health-check'
static description = 'Generate health check report'
static options: CommandOptions = {
startApp: true,
}
async run() {
const { healthChecks } = await import('#start/health')
const report = await healthChecks.run()
await HealthCheckReportCreated.dispatch(report)
}
} |
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
-
Package version
6.12.1
Describe the bug
When attempting to create a command that can run a health check, in my case for automated weekly reports sent to our IT email, I get a variety of issues that prevent any such action. I've attempted to make sure that the server is started, expecting that it would just... work. The connection to the SQLite db is the initial issue it seems, and removing that checks only returns an
undefined
report object.This is my command setup, trying both
ready
events.This is my simple
start/health.ts
and this is the output
Reproduction repo
No response
Beta Was this translation helpful? Give feedback.
All reactions