Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions packages/client/src/sync/fetcher/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@
protected destroyWhenDone: boolean // Destroy the fetcher once we are finished processing each task.
syncErrored?: Error

private _readableState?: {
// This property is inherited from Readable. We only need `length`.
length: number
}

private writer: Writable | null = null

/**
Expand Down Expand Up @@ -352,10 +347,13 @@
return false
}
const jobStr = this.jobStr(job)
if (this._readableState === undefined || this._readableState!.length > this.maxQueue) {
if (
(this as any)._readableState === undefined ||
(this as any)._readableState!.length > this.maxQueue
) {
this.DEBUG &&
this.debug(
`Readable state length=${this._readableState!.length} exceeds max queue size=${
`Readable state length=${(this as any)._readableState!.length} exceeds max queue size=${

Check warning on line 356 in packages/client/src/sync/fetcher/fetcher.ts

View check run for this annotation

Codecov / codecov/patch

packages/client/src/sync/fetcher/fetcher.ts#L356

Added line #L356 was not covered by tests
this.maxQueue
}, skip job ${jobStr} execution.`,
)
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/sync/fetcher/fetcher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('should handle expiration', async () => {
})

fetcher['in'].insert(job as any)
fetcher['_readableState'] = []
;(<any>fetcher)['_readableState'] = []
fetcher['running'] = true
fetcher['total'] = 10
fetcher.next()
Expand Down
Loading