mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-28 01:28:13 -05:00
fix: throttle progress (#6867)
Related: https://github.com/teambit/bit/pull/7703
This commit is contained in:
5
.changeset/empty-pugs-design.md
Normal file
5
.changeset/empty-pugs-design.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/default-reporter": patch
|
||||
---
|
||||
|
||||
When progress is throttled, the last stats should be printed, when importing is done.
|
||||
@@ -53,16 +53,16 @@ function throttledProgressOutput (
|
||||
importingDone$: Rx.Observable<boolean>,
|
||||
progress$: Rx.Observable<ProgressStats>
|
||||
) {
|
||||
let combinedProgress = Rx.combineLatest(
|
||||
if (throttle != null) {
|
||||
progress$ = progress$.pipe(throttle)
|
||||
}
|
||||
const combinedProgress = Rx.combineLatest(
|
||||
progress$,
|
||||
importingDone$
|
||||
)
|
||||
// Avoid logs after all resolved packages were downloaded.
|
||||
// Fixing issue: https://github.com/pnpm/pnpm/issues/1028#issuecomment-364782901
|
||||
.pipe(takeWhile(([, importingDone]) => !importingDone, true))
|
||||
if (throttle != null) {
|
||||
combinedProgress = combinedProgress.pipe(throttle)
|
||||
}
|
||||
return combinedProgress.pipe(map(createStatusMessage))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user