Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Agent health status #55

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/agent-service/src/agent-service.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@ export class AgentServiceService {
async getAgentHealthDetails(orgId: number): Promise<object> {
try {
const orgAgentDetails: org_agents = await this.agentServiceRepository.getOrgAgentDetails(orgId);
if (!orgAgentDetails) {
throw new NotFoundException(ResponseMessages.agent.error.agentNotExists);
}
if (orgAgentDetails.agentEndPoint) {
const data = await this.commonService
.httpGet(`${orgAgentDetails.agentEndPoint}/agent`, { headers: { 'x-api-key': '' } })
Expand All @@ -857,6 +860,7 @@ export class AgentServiceService {

} catch (error) {
this.logger.error(`Agent health details : ${JSON.stringify(error)}`);
throw new RpcException(error);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion apps/ledger/src/schema/repositories/schema.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export class SchemaRepository {
});
const schemasCount = await this.prisma.schema.count({
where: {
orgId
organisation: {
id: orgId
}
}
});
return {schemasCount, schemasResult};
Expand Down
3 changes: 2 additions & 1 deletion libs/common/src/response-messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ export const ResponseMessages = {
apiEndpointNotFound: 'apiEndpoint not found',
notAbleToSpinUpAgent: 'Agent not able to spin-up',
alreadySpinUp: 'Agent already spin-up',
agentUrl: 'Agent url not exist'
agentUrl: 'Agent url not exist',
agentNotExists: 'Agent not spinned up for this organization'
}
},
connection: {
Expand Down