@naturalcycles/datastore-lib 4.16.0 → 4.16.1

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.
@@ -1,6 +1,7 @@
1
1
  import { BaseCommonDB, commonDBFullSupport } from '@naturalcycles/db-lib';
2
2
  import { _round } from '@naturalcycles/js-lib';
3
3
  import { _chunk } from '@naturalcycles/js-lib/array/array.util.js';
4
+ import { _ms } from '@naturalcycles/js-lib/datetime/time.util.js';
4
5
  import { _assert } from '@naturalcycles/js-lib/error/assert.js';
5
6
  import { _errorDataAppend, TimeoutError } from '@naturalcycles/js-lib/error/error.util.js';
6
7
  import { _omit } from '@naturalcycles/js-lib/object/object.util.js';
@@ -112,7 +113,7 @@ export class DatastoreDB extends BaseCommonDB {
112
113
  // Not a timeout error, re-throw
113
114
  throw err;
114
115
  }
115
- this.cfg.logger.log('datastore recreated on error');
116
+ this.cfg.logger.log(`datastore recreated on timeout (${_ms(this.cfg.timeout)}) while loading ${table}`);
116
117
  // This is to debug "GCP Datastore Timeout issue"
117
118
  const datastoreLib = await this.getDatastoreLib();
118
119
  const DS = datastoreLib.Datastore;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/datastore-lib",
3
3
  "type": "module",
4
- "version": "4.16.0",
4
+ "version": "4.16.1",
5
5
  "description": "Opinionated library to work with Google Datastore, implements CommonDB",
6
6
  "dependencies": {
7
7
  "@google-cloud/datastore": "^10",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^24",
14
- "@naturalcycles/dev-lib": "19.37.0"
14
+ "@naturalcycles/dev-lib": "18.4.2"
15
15
  },
16
16
  "exports": {
17
17
  ".": "./dist/index.js"
@@ -16,6 +16,7 @@ import type {
16
16
  import { BaseCommonDB, commonDBFullSupport } from '@naturalcycles/db-lib'
17
17
  import { _round } from '@naturalcycles/js-lib'
18
18
  import { _chunk } from '@naturalcycles/js-lib/array/array.util.js'
19
+ import { _ms } from '@naturalcycles/js-lib/datetime/time.util.js'
19
20
  import { _assert } from '@naturalcycles/js-lib/error/assert.js'
20
21
  import { _errorDataAppend, TimeoutError } from '@naturalcycles/js-lib/error/error.util.js'
21
22
  import type {
@@ -182,7 +183,9 @@ export class DatastoreDB extends BaseCommonDB implements CommonDB {
182
183
  throw err
183
184
  }
184
185
 
185
- this.cfg.logger.log('datastore recreated on error')
186
+ this.cfg.logger.log(
187
+ `datastore recreated on timeout (${_ms(this.cfg.timeout)}) while loading ${table}`,
188
+ )
186
189
 
187
190
  // This is to debug "GCP Datastore Timeout issue"
188
191
  const datastoreLib = await this.getDatastoreLib()