(showInitialStatus = true)
| 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(' ') |
no test coverage detected