@naturalcycles/datastore-lib 3.30.0 → 3.30.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.
@@ -93,7 +93,10 @@ class DatastoreStreamReadable extends node_stream_1.Readable {
93
93
  return;
94
94
  }
95
95
  this.rowsRetrieved += rows.length;
96
- this.logger.log(`got ${rows.length} rows, ${this.rowsRetrieved} rowsRetrieved, totalWait: ${(0, js_lib_1._ms)(this.totalWait)}`, info.moreResults);
96
+ this.logger.log(`${this.table} got ${rows.length} rows, ${this.rowsRetrieved} rowsRetrieved, totalWait: ${(0, js_lib_1._ms)(this.totalWait)}`, info.moreResults);
97
+ if (!rows.length) {
98
+ this.logger.warn(`${this.table} got 0 rows, totalWait: ${(0, js_lib_1._ms)(this.totalWait)}`, info.moreResults);
99
+ }
97
100
  this.endCursor = info.endCursor;
98
101
  this.running = false; // ready to take more _reads
99
102
  this.lastQueryDone = Date.now();
@@ -116,7 +119,7 @@ class DatastoreStreamReadable extends node_stream_1.Readable {
116
119
  void this.runNextQuery();
117
120
  }
118
121
  else {
119
- this.logger.log(`rssLimitMB reached ${rssMB} > ${this.opt.rssLimitMB}, pausing stream`);
122
+ this.logger.warn(`${this.table} rssLimitMB reached ${rssMB} > ${this.opt.rssLimitMB}, pausing stream`);
120
123
  }
121
124
  }
122
125
  }
@@ -116,12 +116,12 @@ export interface DatastoreStats {
116
116
  export declare enum DatastoreType {
117
117
  Blob = "Blob",
118
118
  Text = "Text",
119
- String = "String",
119
+ String = "String",// eslint-disable-line id-blacklist
120
120
  EmbeddedEntity = "EmbeddedEntity",
121
121
  Float = "Float",
122
122
  Integer = "Integer",
123
123
  DATE_TIME = "Date/Time",
124
- Boolean = "Boolean",
124
+ Boolean = "Boolean",// eslint-disable-line id-blacklist
125
125
  NULL = "NULL"
126
126
  }
127
127
  export interface DatastorePropertyStats {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/datastore-lib",
3
- "version": "3.30.0",
3
+ "version": "3.30.2",
4
4
  "description": "Opinionated library to work with Google Datastore",
5
5
  "scripts": {
6
6
  "prepare": "husky install"
@@ -128,12 +128,19 @@ export class DatastoreStreamReadable<T = any> extends Readable implements Readab
128
128
 
129
129
  this.rowsRetrieved += rows.length
130
130
  this.logger.log(
131
- `got ${rows.length} rows, ${this.rowsRetrieved} rowsRetrieved, totalWait: ${_ms(
131
+ `${this.table} got ${rows.length} rows, ${this.rowsRetrieved} rowsRetrieved, totalWait: ${_ms(
132
132
  this.totalWait,
133
133
  )}`,
134
134
  info.moreResults,
135
135
  )
136
136
 
137
+ if (!rows.length) {
138
+ this.logger.warn(
139
+ `${this.table} got 0 rows, totalWait: ${_ms(this.totalWait)}`,
140
+ info.moreResults,
141
+ )
142
+ }
143
+
137
144
  this.endCursor = info.endCursor
138
145
  this.running = false // ready to take more _reads
139
146
  this.lastQueryDone = Date.now()
@@ -160,7 +167,9 @@ export class DatastoreStreamReadable<T = any> extends Readable implements Readab
160
167
  if (rssMB <= this.opt.rssLimitMB) {
161
168
  void this.runNextQuery()
162
169
  } else {
163
- this.logger.log(`rssLimitMB reached ${rssMB} > ${this.opt.rssLimitMB}, pausing stream`)
170
+ this.logger.warn(
171
+ `${this.table} rssLimitMB reached ${rssMB} > ${this.opt.rssLimitMB}, pausing stream`,
172
+ )
164
173
  }
165
174
  }
166
175
  }
@@ -53,7 +53,7 @@ export class DatastoreKeyValueDB implements CommonKeyValueDB {
53
53
  .streamQuery<KVObject>(q)
54
54
  .on('error', err => stream.emit('error', err))
55
55
  .pipe(
56
- transformMapSimple<ObjectWithId<string>, string>(objectWithId => objectWithId.id, {
56
+ transformMapSimple<ObjectWithId, string>(objectWithId => objectWithId.id, {
57
57
  errorMode: ErrorMode.SUPPRESS, // cause .pipe() cannot propagate errors
58
58
  }),
59
59
  )