pinokiod 3.15.4 → 3.15.6
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.
- package/kernel/index.js +1 -0
- package/kernel/procs.js +13 -7
- package/package.json +1 -1
package/kernel/index.js
CHANGED
package/kernel/procs.js
CHANGED
|
@@ -130,24 +130,28 @@ class Procs {
|
|
|
130
130
|
this.port_cb = cb
|
|
131
131
|
this.port_running = true
|
|
132
132
|
if (sh) {
|
|
133
|
+
console.log("Shell exists")
|
|
133
134
|
this.emit(id, cmd)
|
|
134
135
|
} else {
|
|
136
|
+
console.log("Shell doesn't exist. create one")
|
|
135
137
|
this.kernel.exec({
|
|
136
138
|
id,
|
|
137
139
|
conda: {
|
|
138
140
|
skip: true,
|
|
139
141
|
},
|
|
140
142
|
onready: () => {
|
|
141
|
-
|
|
143
|
+
console.log("ON READY", { id, cmd })
|
|
142
144
|
this.emit(id, cmd)
|
|
143
145
|
},
|
|
144
146
|
input: true
|
|
145
147
|
}, (e) => {
|
|
146
148
|
if (e.state && e.state.includes(cls)) {
|
|
149
|
+
console.log({ port_running: this.port_running })
|
|
147
150
|
if (this.port_running) {
|
|
148
151
|
this.port_running = false
|
|
149
|
-
|
|
152
|
+
console.log("GET PIDS")
|
|
150
153
|
this.get_pids(e.state).then((pids) => {
|
|
154
|
+
console.log({ pids })
|
|
151
155
|
this.portPidList = pids
|
|
152
156
|
this.port_cb(pids)
|
|
153
157
|
})
|
|
@@ -236,23 +240,25 @@ class Procs {
|
|
|
236
240
|
}
|
|
237
241
|
}
|
|
238
242
|
async refresh() {
|
|
243
|
+
console.log("Procs.refresh")
|
|
239
244
|
let map = {}
|
|
240
|
-
if (this.refreshing) {
|
|
241
|
-
// console.log("still refreshing. retry later")
|
|
242
|
-
return
|
|
243
|
-
}
|
|
244
245
|
this.refreshing = true
|
|
245
246
|
let ts = Date.now()
|
|
246
247
|
let list = await new Promise((resolve, reject) => {
|
|
247
248
|
// console.time(">>>>>>>>GET PORTS " + ts)
|
|
249
|
+
console.log("get ports")
|
|
248
250
|
this.getPortPidList((portPidList) => {
|
|
249
|
-
console(
|
|
251
|
+
console.log("done: get ports")
|
|
252
|
+
console.log({ portPidList })
|
|
250
253
|
// console.timeEnd(">>>>>>>>GET PORTS " + ts)
|
|
251
254
|
// console.time(">>>>>>> GET PIDS " + ts)
|
|
252
255
|
// if there's any new port, run getPidToNameMap
|
|
253
256
|
|
|
254
257
|
|
|
258
|
+
console.log("getPid")
|
|
255
259
|
this.getPidToNameMap(portPidList, (pidToName) => {
|
|
260
|
+
console.log("done getPid")
|
|
261
|
+
|
|
256
262
|
// console.timeEnd(">>>>>>> GET PIDS " + ts)
|
|
257
263
|
let list = portPidList.map(({ port, pid, ip }) => {
|
|
258
264
|
const fullname = pidToName[pid] || 'Unknown';
|