@naturalcycles/firestore-lib 2.13.2 → 2.14.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.
|
@@ -22,7 +22,6 @@ export class FirestoreShardedReadable extends Readable {
|
|
|
22
22
|
nextShard = 1;
|
|
23
23
|
cursorByShard = {};
|
|
24
24
|
queryIsRunningByShard = {};
|
|
25
|
-
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: ok
|
|
26
25
|
paused = false;
|
|
27
26
|
done = false;
|
|
28
27
|
doneShards = new Set();
|
|
@@ -156,7 +155,6 @@ export class FirestoreShardedReadable extends Readable {
|
|
|
156
155
|
rowsRetrieved: this.rowsRetrieved,
|
|
157
156
|
}, err);
|
|
158
157
|
this.destroy(err);
|
|
159
|
-
return;
|
|
160
158
|
}
|
|
161
159
|
}
|
|
162
160
|
findNextFreeShard() {
|
|
@@ -166,7 +164,6 @@ export class FirestoreShardedReadable extends Readable {
|
|
|
166
164
|
}
|
|
167
165
|
}
|
|
168
166
|
}
|
|
169
|
-
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: ok
|
|
170
167
|
_getNextShardAndMove() {
|
|
171
168
|
const shard = this.nextShard;
|
|
172
169
|
this.nextShard = shard === SHARDS ? 1 : shard + 1;
|
|
@@ -53,7 +53,7 @@ export class FirestoreStreamReadable extends Readable {
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
if (this.paused) {
|
|
56
|
-
this.logger.
|
|
56
|
+
this.logger.debug(`_read #${this.countReads}, queryIsRunning: ${this.queryIsRunning}, unpausing stream`);
|
|
57
57
|
this.paused = false;
|
|
58
58
|
}
|
|
59
59
|
if (this.queryIsRunning) {
|
|
@@ -125,7 +125,7 @@ export class FirestoreStreamReadable extends Readable {
|
|
|
125
125
|
logger.debug(`${table} stream is already paused`);
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
|
-
logger.
|
|
128
|
+
logger.debug(`${table} pausing the stream`);
|
|
129
129
|
this.paused = true;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -152,7 +152,6 @@ export class FirestoreStreamReadable extends Readable {
|
|
|
152
152
|
rowsRetrieved: this.rowsRetrieved,
|
|
153
153
|
}, err);
|
|
154
154
|
this.destroy(err);
|
|
155
|
-
return;
|
|
156
155
|
}
|
|
157
156
|
}
|
|
158
157
|
}
|
package/package.json
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
"name": "@naturalcycles/firestore-lib",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@google-cloud/firestore": "^
|
|
5
|
+
"@google-cloud/firestore": "^8",
|
|
6
6
|
"@naturalcycles/db-lib": "^10",
|
|
7
7
|
"@naturalcycles/js-lib": "^15",
|
|
8
8
|
"@naturalcycles/nodejs-lib": "^15",
|
|
9
9
|
"tslib": "^2"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@types/node": "^
|
|
12
|
+
"@types/node": "^25",
|
|
13
13
|
"dotenv": "^17",
|
|
14
14
|
"firebase-admin": "^13",
|
|
15
|
-
"@naturalcycles/dev-lib": "
|
|
15
|
+
"@naturalcycles/dev-lib": "18.4.2"
|
|
16
16
|
},
|
|
17
17
|
"exports": {
|
|
18
18
|
".": "./dist/index.js"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=24.10.0"
|
|
40
40
|
},
|
|
41
|
-
"version": "2.
|
|
41
|
+
"version": "2.14.1",
|
|
42
42
|
"description": "Firestore implementation of CommonDB interface",
|
|
43
43
|
"author": "Natural Cycles Team",
|
|
44
44
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@ export class FirestoreShardedReadable<T extends ObjectWithId = any>
|
|
|
34
34
|
private nextShard = 1
|
|
35
35
|
private cursorByShard: StringMap = {}
|
|
36
36
|
private queryIsRunningByShard: StringMap<boolean> = {}
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
private paused = false
|
|
39
39
|
private done = false
|
|
40
40
|
private doneShards = new Set<PositiveInteger>()
|
|
@@ -214,7 +214,6 @@ export class FirestoreShardedReadable<T extends ObjectWithId = any>
|
|
|
214
214
|
err,
|
|
215
215
|
)
|
|
216
216
|
this.destroy(err as Error)
|
|
217
|
-
return
|
|
218
217
|
}
|
|
219
218
|
}
|
|
220
219
|
|
|
@@ -226,7 +225,6 @@ export class FirestoreShardedReadable<T extends ObjectWithId = any>
|
|
|
226
225
|
}
|
|
227
226
|
}
|
|
228
227
|
|
|
229
|
-
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: ok
|
|
230
228
|
private _getNextShardAndMove(): PositiveInteger {
|
|
231
229
|
const shard = this.nextShard
|
|
232
230
|
this.nextShard = shard === SHARDS ? 1 : shard + 1
|
|
@@ -77,7 +77,7 @@ export class FirestoreStreamReadable<T extends ObjectWithId = any>
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
if (this.paused) {
|
|
80
|
-
this.logger.
|
|
80
|
+
this.logger.debug(
|
|
81
81
|
`_read #${this.countReads}, queryIsRunning: ${this.queryIsRunning}, unpausing stream`,
|
|
82
82
|
)
|
|
83
83
|
this.paused = false
|
|
@@ -166,7 +166,7 @@ export class FirestoreStreamReadable<T extends ObjectWithId = any>
|
|
|
166
166
|
if (this.paused) {
|
|
167
167
|
logger.debug(`${table} stream is already paused`)
|
|
168
168
|
} else {
|
|
169
|
-
logger.
|
|
169
|
+
logger.debug(`${table} pausing the stream`)
|
|
170
170
|
this.paused = true
|
|
171
171
|
}
|
|
172
172
|
}
|
|
@@ -201,7 +201,6 @@ export class FirestoreStreamReadable<T extends ObjectWithId = any>
|
|
|
201
201
|
err,
|
|
202
202
|
)
|
|
203
203
|
this.destroy(err as Error)
|
|
204
|
-
return
|
|
205
204
|
}
|
|
206
205
|
}
|
|
207
206
|
}
|