@naturalcycles/datastore-lib 3.39.0 → 3.39.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.
|
@@ -20,7 +20,7 @@ export declare class DatastoreStreamReadable<T = any> extends Readable implement
|
|
|
20
20
|
private lastReadTimestamp;
|
|
21
21
|
private readonly maxWaitInterval;
|
|
22
22
|
private readonly opt;
|
|
23
|
-
private dsOpt;
|
|
23
|
+
private readonly dsOpt;
|
|
24
24
|
constructor(q: Query, opt: DatastoreDBStreamOptions, logger: CommonLogger);
|
|
25
25
|
private runNextQuery;
|
|
26
26
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Readable } from 'node:stream'
|
|
2
2
|
import { Query } from '@google-cloud/datastore'
|
|
3
3
|
import type { RunQueryInfo, RunQueryOptions } from '@google-cloud/datastore/build/src/query'
|
|
4
|
-
import { _ms, CommonLogger, pRetry,
|
|
4
|
+
import { _ms, CommonLogger, pRetry, UnixTimestampMillis } from '@naturalcycles/js-lib'
|
|
5
5
|
import type { ReadableTyped } from '@naturalcycles/nodejs-lib'
|
|
6
6
|
import type { DatastoreDBStreamOptions } from './datastore.model'
|
|
7
7
|
|
|
@@ -17,11 +17,11 @@ export class DatastoreStreamReadable<T = any> extends Readable implements Readab
|
|
|
17
17
|
/**
|
|
18
18
|
* Used to support maxWait
|
|
19
19
|
*/
|
|
20
|
-
private lastReadTimestamp
|
|
20
|
+
private lastReadTimestamp = 0 as UnixTimestampMillis
|
|
21
21
|
private readonly maxWaitInterval: NodeJS.Timeout | undefined
|
|
22
22
|
|
|
23
23
|
private readonly opt: DatastoreDBStreamOptions & { batchSize: number }
|
|
24
|
-
private dsOpt: RunQueryOptions
|
|
24
|
+
private readonly dsOpt: RunQueryOptions
|
|
25
25
|
|
|
26
26
|
constructor(
|
|
27
27
|
private q: Query,
|
|
@@ -187,7 +187,7 @@ export class DatastoreStreamReadable<T = any> extends Readable implements Readab
|
|
|
187
187
|
count = 0
|
|
188
188
|
|
|
189
189
|
override _read(): void {
|
|
190
|
-
this.lastReadTimestamp = Date.now()
|
|
190
|
+
this.lastReadTimestamp = Date.now() as UnixTimestampMillis
|
|
191
191
|
|
|
192
192
|
// console.log(`_read called ${++this.count}, wasRunning: ${this.running}`) // debugging
|
|
193
193
|
this.count++
|