Skip to content

Commit 230e359

Browse files
committed
chore: add timeout and retry to ky
1 parent e5510ef commit 230e359

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

functions/database/submissions/onCreateAddLocation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ safelyInitializeApp();
88
const client = ky.extend({
99
prefixUrl:
1010
'https://services1.arcgis.com/99lidPhWCzftIe9K/arcgis/rest/services',
11-
timeout: 30000,
11+
timeout: 40000,
1212
retry: 3,
1313
});
1414

src/components/machines/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import {
1010
roundAccurately,
1111
} from '../../../functions/shared/index.js';
1212

13+
const client = ky.extend({
14+
timeout: 40000,
15+
retry: 3,
16+
});
17+
1318
export const updateContext = (context, field, value) => {
1419
if (!field) {
1520
return context;
@@ -44,7 +49,7 @@ const project = (grid) => {
4449
formData.append(key, value);
4550
});
4651

47-
return ky
52+
return client
4853
.post('project', {
4954
body: formData,
5055
prefixUrl: 'https://mapserv.utah.gov/arcgis/rest/services/Geometry/GeometryServer',
@@ -72,7 +77,7 @@ const queryForCounty = (decimalDegrees) => {
7277
formData.append('inSR', '6318');
7378
formData.append('f', 'json');
7479

75-
return ky
80+
return client
7681
.post('query', {
7782
body: formData,
7883
prefixUrl:
@@ -97,7 +102,7 @@ const projectToStatePlane = (coordinates) => {
97102
formData.append(key, value);
98103
});
99104

100-
return ky
105+
return client
101106
.post('project', {
102107
body: formData,
103108
prefixUrl: 'https://mapserv.utah.gov/arcgis/rest/services/Geometry/GeometryServer',

0 commit comments

Comments
 (0)