@naturalcycles/datastore-lib 3.26.0 → 3.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/datastore.db.js +10 -3
- package/package.json +1 -1
- package/src/datastore.db.ts +10 -3
package/dist/datastore.db.js
CHANGED
|
@@ -10,7 +10,14 @@ const DatastoreStreamReadable_1 = require("./DatastoreStreamReadable");
|
|
|
10
10
|
const query_util_1 = require("./query.util");
|
|
11
11
|
// Datastore (also Firestore and other Google APIs) supports max 500 of items when saving/deleting, etc.
|
|
12
12
|
const MAX_ITEMS = 500;
|
|
13
|
-
const RETRY_ON = [
|
|
13
|
+
const RETRY_ON = [
|
|
14
|
+
'GOAWAY',
|
|
15
|
+
'UNAVAILABLE',
|
|
16
|
+
'UNKNOWN',
|
|
17
|
+
'DEADLINE_EXCEEDED',
|
|
18
|
+
'much contention',
|
|
19
|
+
'timeout',
|
|
20
|
+
].map(s => s.toLowerCase());
|
|
14
21
|
// Examples of errors:
|
|
15
22
|
// UNKNOWN: Stream removed
|
|
16
23
|
const methodMap = {
|
|
@@ -365,9 +372,9 @@ class DatastoreDB extends db_lib_1.BaseCommonDB {
|
|
|
365
372
|
}
|
|
366
373
|
getPRetryOptions(name) {
|
|
367
374
|
return {
|
|
368
|
-
predicate: err => RETRY_ON.some(s => err?.message?.includes(s)),
|
|
375
|
+
predicate: err => RETRY_ON.some(s => err?.message?.toLowerCase()?.includes(s)),
|
|
369
376
|
name,
|
|
370
|
-
timeout:
|
|
377
|
+
timeout: 20000,
|
|
371
378
|
maxAttempts: 5,
|
|
372
379
|
delay: 5000,
|
|
373
380
|
delayMultiplier: 1.5,
|
package/package.json
CHANGED
package/src/datastore.db.ts
CHANGED
|
@@ -47,7 +47,14 @@ import { dbQueryToDatastoreQuery } from './query.util'
|
|
|
47
47
|
// Datastore (also Firestore and other Google APIs) supports max 500 of items when saving/deleting, etc.
|
|
48
48
|
const MAX_ITEMS = 500
|
|
49
49
|
|
|
50
|
-
const RETRY_ON = [
|
|
50
|
+
const RETRY_ON = [
|
|
51
|
+
'GOAWAY',
|
|
52
|
+
'UNAVAILABLE',
|
|
53
|
+
'UNKNOWN',
|
|
54
|
+
'DEADLINE_EXCEEDED',
|
|
55
|
+
'much contention',
|
|
56
|
+
'timeout',
|
|
57
|
+
].map(s => s.toLowerCase())
|
|
51
58
|
// Examples of errors:
|
|
52
59
|
// UNKNOWN: Stream removed
|
|
53
60
|
|
|
@@ -515,9 +522,9 @@ export class DatastoreDB extends BaseCommonDB implements CommonDB {
|
|
|
515
522
|
|
|
516
523
|
private getPRetryOptions(name: string): PRetryOptions {
|
|
517
524
|
return {
|
|
518
|
-
predicate: err => RETRY_ON.some(s => err?.message?.includes(s)),
|
|
525
|
+
predicate: err => RETRY_ON.some(s => err?.message?.toLowerCase()?.includes(s)),
|
|
519
526
|
name,
|
|
520
|
-
timeout:
|
|
527
|
+
timeout: 20_000,
|
|
521
528
|
maxAttempts: 5,
|
|
522
529
|
delay: 5000,
|
|
523
530
|
delayMultiplier: 1.5,
|