fix(SEC-ORCH-16): Implement real health and readiness checks
- Add ping() method to ValkeyClient and ValkeyService for health checks - Update HealthService to check Valkey connectivity before reporting ready - /health/ready now returns 503 if dependencies are unhealthy - Add detailed checks object showing individual dependency status - Update tests with ValkeyService mock Refs #339 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -71,6 +71,19 @@ export class ValkeyClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Valkey connectivity
|
||||
* @returns true if connection is healthy, false otherwise
|
||||
*/
|
||||
async ping(): Promise<boolean> {
|
||||
try {
|
||||
await this.client.ping();
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Task State Management
|
||||
*/
|
||||
|
||||
@@ -152,4 +152,12 @@ export class ValkeyService implements OnModuleDestroy {
|
||||
};
|
||||
await this.setAgentState(state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Valkey connectivity
|
||||
* @returns true if connection is healthy, false otherwise
|
||||
*/
|
||||
async ping(): Promise<boolean> {
|
||||
return this.client.ping();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user