Skip to content

Commit

Permalink
Fix duplicated process statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed May 1, 2024
1 parent c8b487e commit 642badc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 4 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ nav_order: 13

All notable changes to this project will be documented in this section.

## [1.0.0-rc.39] - Unstable

- fix(core): Clustered processes were duplicated in API and `pup status`

## [1.0.0-rc.38] - 2024-05-01

- chore(core): Dependency update
Expand Down
6 changes: 3 additions & 3 deletions lib/core/pup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ class Pup {
public allProcesses(): Process[] {
const allProcesses = []
for (const process of this.processes) {
// Always add current process (even clusters)
allProcesses.push(process)

// Add all subprocesses if current process is a cluster
if (process instanceof Cluster) {
for (const cProcess of process.processes) {
allProcesses.push(cProcess)
}
}

// Always add current process (even clusters)
allProcesses.push(process)
}
return allProcesses
}
Expand Down
5 changes: 0 additions & 5 deletions lib/core/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ class Status {
const processStates: ProcessInformation[] = []
for (const p of processes) {
processStates.push(p.getStatus())
if (p.isCluster()) {
for (const subP of (p as Cluster).processes) {
processStates.push(subP.getStatus())
}
}
}
return {
pid: Deno.pid,
Expand Down

0 comments on commit 642badc

Please sign in to comment.