Merge branch 'healthservice' into 'main'
add health service See merge request v3/service/user!29
This commit is contained in:
commit
bb9d6db6a2
|
@ -33,3 +33,20 @@ message Users {
|
|||
}
|
||||
|
||||
message Empty {}
|
||||
|
||||
service Health {
|
||||
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
|
||||
}
|
||||
|
||||
message HealthCheckRequest {
|
||||
string service = 1;
|
||||
}
|
||||
|
||||
message HealthCheckResponse {
|
||||
enum ServingStatus {
|
||||
UNKNOWN = 0;
|
||||
SERVING = 1;
|
||||
NOT_SERVING = 2;
|
||||
}
|
||||
ServingStatus status = 1;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,12 @@ import { UserPresenter } from './user.presenter';
|
|||
import { ICollection } from '../../../database/src/interfaces/collection.interface';
|
||||
import { RpcValidationPipe } from '../../../../utils/pipes/rpc.validation-pipe';
|
||||
|
||||
enum ServingStatus {
|
||||
UNKNOWN = 0,
|
||||
SERVING = 1,
|
||||
NOT_SERVING = 2,
|
||||
}
|
||||
|
||||
@UsePipes(
|
||||
new RpcValidationPipe({
|
||||
whitelist: true,
|
||||
|
@ -123,4 +129,11 @@ export class UsersController {
|
|||
throw new RpcException({});
|
||||
}
|
||||
}
|
||||
|
||||
@GrpcMethod('Health', 'Check')
|
||||
async check(): Promise<{ status: ServingStatus }> {
|
||||
return {
|
||||
status: ServingStatus.SERVING,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue