MCPcopy Index your code
hub / github.com/cloudgraphdev/cli / healthCheck

Method healthCheck

src/storage/dgraph/index.ts:27–46  ·  view source on GitHub ↗
(showInitialStatus = true)

Source from the content-addressed store, hash-verified

25 axiosPromises: (() => Promise<void>)[]
26
27 async healthCheck(showInitialStatus = true): Promise<boolean> {
28 showInitialStatus &&
29 this.logger.debug(`running dgraph health check at ${this.host}`)
30 try {
31 const healthCheck = await this.generateAxiosRequest({
32 path: '/health?all',
33 headers: {
34 'Content-Type': 'application/json',
35 },
36 })
37 this.logger.debug(healthCheck.data)
38 return true
39 } catch (error: any) {
40 this.logger.warn(
41 `dgraph at ${this.host} failed health check. Is dgraph running?`
42 )
43 this.logger.debug(error)
44 return false
45 }
46 }
47
48 async validateSchema(schema: string[], versionString: string): Promise<void> {
49 const versionCaption = versionString.split('-').join(' ')

Callers 4

runMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 1

generateAxiosRequestMethod · 0.80

Tested by

no test coverage detected