Use 429 to indicate timeout errors
This commit is contained in:
parent
bb59902535
commit
5974413d5c
@ -301,5 +301,12 @@ function statusFromErrorMessage(errMsg) {
|
|||||||
statusCode = 404;
|
statusCode = 404;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ( -1 !== errMsg.indexOf('Render timed out') ) {
|
||||||
|
statusCode = 429; // under discussion
|
||||||
|
}
|
||||||
|
else if ( -1 !== errMsg.indexOf('canceling statement due to statement timeout') ) {
|
||||||
|
statusCode = 429; // under discussion
|
||||||
|
}
|
||||||
|
|
||||||
return statusCode;
|
return statusCode;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ describe('user database timeout limit', function () {
|
|||||||
it('layergroup creation works but dataview request fails due to statement timeout', function (done) {
|
it('layergroup creation works but dataview request fails due to statement timeout', function (done) {
|
||||||
const params = {
|
const params = {
|
||||||
response: {
|
response: {
|
||||||
status: 400,
|
status: 429,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json; charset=utf-8'
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ describe('user database timeout limit', function () {
|
|||||||
|
|
||||||
it('fails due to statement timeout', function (done) {
|
it('fails due to statement timeout', function (done) {
|
||||||
const expectedResponse = {
|
const expectedResponse = {
|
||||||
status: 400,
|
status: 429,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json; charset=utf-8'
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ describe('user database timeout limit', function () {
|
|||||||
format: 'torque.json',
|
format: 'torque.json',
|
||||||
layers: [ 0 ],
|
layers: [ 0 ],
|
||||||
response: {
|
response: {
|
||||||
status: 400,
|
status: 429,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json; charset=utf-8'
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@ describe('user database timeout limit', function () {
|
|||||||
|
|
||||||
it('layergroup creation fails due to statement timeout', function (done) {
|
it('layergroup creation fails due to statement timeout', function (done) {
|
||||||
const expectedResponse = {
|
const expectedResponse = {
|
||||||
status: 400,
|
status: 429,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json; charset=utf-8'
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ describe('user database timeout limit', function () {
|
|||||||
featureId: 1,
|
featureId: 1,
|
||||||
layer: 0,
|
layer: 0,
|
||||||
response: {
|
response: {
|
||||||
status: 400,
|
status: 429,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json; charset=utf-8'
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ describe('user render timeout limit', function () {
|
|||||||
|
|
||||||
it('layergroup creation fails due to statement timeout', function (done) {
|
it('layergroup creation fails due to statement timeout', function (done) {
|
||||||
const expectedResponse = {
|
const expectedResponse = {
|
||||||
status: 400,
|
status: 429,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json; charset=utf-8'
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@ describe('user render timeout limit', function () {
|
|||||||
it('layergroup creation works and render tile fails', function (done) {
|
it('layergroup creation works and render tile fails', function (done) {
|
||||||
var params = {
|
var params = {
|
||||||
response: {
|
response: {
|
||||||
status: 400,
|
status: 429,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json; charset=utf-8'
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ describe('user render timeout limit', function () {
|
|||||||
const params = {
|
const params = {
|
||||||
format: 'mvt',
|
format: 'mvt',
|
||||||
response: {
|
response: {
|
||||||
status: 400,
|
status: 429,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json; charset=utf-8'
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ describe('user render timeout limit', function () {
|
|||||||
layers: 'mapnik',
|
layers: 'mapnik',
|
||||||
format: 'grid.json',
|
format: 'grid.json',
|
||||||
response: {
|
response: {
|
||||||
status: 400,
|
status: 429,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-protobuf'
|
'Content-Type': 'application/x-protobuf'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user