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

Allow Reporting endpoints more time to respond #737

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 9 additions & 0 deletions server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ export default {
agent: new AgentConfig(Number(get('COMMUNITY_ACCOMMODATION_API_TIMEOUT_RESPONSE', 10000))),
serviceName: 'temporary-accommodation',
},
approvedPremisesReports: {
url: get('APPROVED_PREMISES_API_URL', 'http://localhost:9092', requiredInProduction),
timeout: {
response: 50000,
deadline: 50000,
},
agent: new AgentConfig(Number(get('COMMUNITY_ACCOMMODATION_API_TIMEOUT_RESPONSE', 40000))),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason this value is 40 seconds as opposed to 50?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it should be 50 thanks! 😬

serviceName: 'temporary-accommodation',
},
audit: {
region: get('AUDIT_SQS_REGION', 'eu-west-2'),
queueUrl: get('AUDIT_SQS_QUEUE_URL', ''),
Expand Down
4 changes: 2 additions & 2 deletions server/data/reportClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ describe('ReportClient', () => {
const callConfig = { token: 'some-token' } as CallConfig

beforeEach(() => {
config.apis.approvedPremises.url = 'http://localhost:8080'
fakeApprovedPremisesApi = nock(config.apis.approvedPremises.url)
config.apis.approvedPremisesReports.url = 'http://localhost:8080'
fakeApprovedPremisesApi = nock(config.apis.approvedPremisesReports.url)
reportClient = new ReportClient(callConfig)
})

Expand Down
2 changes: 1 addition & 1 deletion server/data/reportClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class ReportClient {
restClient: RestClient

constructor(callConfig: CallConfig) {
this.restClient = new RestClient('personClient', config.apis.approvedPremises as ApiConfig, callConfig)
this.restClient = new RestClient('personClient', config.apis.approvedPremisesReports as ApiConfig, callConfig)
}

async bookings(response: Response, filename: string, month: string, year: string): Promise<void> {
Expand Down