Skip to content

Commit 995a3b2

Browse files
Merge pull request #67 from NHSDigital/apm-3416-timeout
APM-3416 Increase sync-wrap timeout to 59 seconds
2 parents b0b1faa + 001d30f commit 995a3b2

8 files changed

Lines changed: 23 additions & 12 deletions

File tree

azure/azure-pr-pipeline.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ extends:
3333
service_name: ${{ variables.service_name }}
3434
service_base_path: ${{ variables.service_base_path }}
3535
short_service_name: ${{ variables.short_service_name }}
36-
product_display_name: ${{ variables.product_display_name }}
37-
product_description: ${{ variables.product_description }}
3836
apigee_deployments:
3937
- environment: internal-dev
4038
post_deploy:

azure/azure-release-pipeline.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ extends:
3131
service_name: ${{ variables.service_name }}
3232
short_service_name: ${{ variables.short_service_name }}
3333
service_base_path: ${{ variables.service_base_path }}
34-
product_display_name: ${{ variables.product_display_name }}
35-
product_description: ${{ variables.product_description }}
3634
enable_monitoring: true
3735
enable_status_monitoring: true
3836
apigee_deployments:

docker/_shared/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ clean:
1111
rm -rf ./node_modules
1212

1313
install:
14-
npm install --include=dev
14+
npm install --include=dev --legacy-peer-deps
1515

1616
update:
1717
npm update

docker/async-slowapp/package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/sync-wrap/package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/sync-wrap/src/app.postman.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,23 @@ describe("express with postman-echo", function () {
163163
.get("/delay/3")
164164
.set("x-sync-wait", "eek")
165165
.set("Accept", "application/json")
166-
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 29"}, done);
166+
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 59"}, done);
167167
});
168168

169169
it("it validates x-sync-wait is > lower bound", (done) => {
170170
request(server)
171171
.get("/delay/3")
172172
.set("x-sync-wait", "0.0001")
173173
.set("Accept", "application/json")
174-
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 29"}, done);
174+
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 59"}, done);
175175
});
176176

177177
it("it validates x-sync-wait is < upper bound", (done) => {
178178
request(server)
179179
.get("/delay/3")
180-
.set("x-sync-wait", "30")
180+
.set("x-sync-wait", "60")
181181
.set("Accept", "application/json")
182-
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 29"}, done);
182+
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 59"}, done);
183183
});
184184

185185
it("it times out if x-sync-wait shorter than initial response", (done) => {

docker/sync-wrap/src/handlers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,16 +335,16 @@ async function proxy(req, res, next) {
335335
if(isNaN(syncWait)){
336336
res.status(400);
337337
res.json({
338-
err: "x-sync-wait should be a number between 0.25 and 29"
338+
err: "x-sync-wait should be a number between 0.25 and 59"
339339
});
340340
next();
341341
return;
342342
}
343343
syncWait = parseFloat(syncWait);
344-
if (syncWait < 0.25 || syncWait > 29) {
344+
if (syncWait < 0.25 || syncWait > 59) {
345345
res.status(400);
346346
res.json({
347-
err: "x-sync-wait should be a number between 0.25 and 29"
347+
err: "x-sync-wait should be a number between 0.25 and 59"
348348
});
349349
next();
350350
return;

proxies/live/apiproxy/targets/apim.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
<PreFlow/>
44
<HTTPTargetConnection>
55
{{ HOSTED_TARGET_CONNECTION }}
6+
<Properties>
7+
<Property name="io.timeout.millis">65000</Property>
8+
</Properties>
69
</HTTPTargetConnection>
710
</TargetEndpoint>

0 commit comments

Comments
 (0)