pinokiod 3.15.21 → 3.15.22

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.
Files changed (2) hide show
  1. package/kernel/procs.js +16 -16
  2. package/package.json +1 -1
package/kernel/procs.js CHANGED
@@ -15,10 +15,12 @@ class Procs {
15
15
  }
16
16
  async isHttp(localAddress) {
17
17
  if (this.cache.hasOwnProperty(localAddress)) {
18
+ console.log("Use cached", localAddress)
18
19
  return this.cache[localAddress]
19
20
  }
21
+ console.log("Not cached", localAddress)
20
22
  try {
21
- await axios.head(`http://${localAddress}`, { timeout: 1000 });
23
+ await axios.head(`http://${localAddress}`, { timeout: 3000 });
22
24
  this.cache[localAddress] = true
23
25
  return true;
24
26
  } catch (err) {
@@ -46,7 +48,7 @@ class Procs {
46
48
  let pids = new Set()
47
49
  let s = stdout.trim()
48
50
  const lines = s.split('\n');
49
- console.time("###### Line parsing")
51
+ // console.time("###### Line parsing")
50
52
  for(let line of lines) {
51
53
  if (isWin) {
52
54
  // Skip headers
@@ -119,15 +121,14 @@ class Procs {
119
121
  }
120
122
  }
121
123
  }
122
- console.timeEnd("###### Line parsing")
123
- console.time("########## http_check")
124
+ // console.timeEnd("###### Line parsing")
125
+ // console.time("########## http_check")
124
126
  const http_check = await Promise.all(results.map(({ ip }) => {
125
127
  return limit(() => {
126
128
  return this.isHttp(ip)
127
129
  })
128
130
  }))
129
- console.timeEnd("########## http_check")
130
- console.log({ http_check })
131
+ // console.timeEnd("########## http_check")
131
132
  let filtered = []
132
133
  for(let i=0; i<http_check.length; i++) {
133
134
  if (http_check[i]) {
@@ -251,26 +252,25 @@ class Procs {
251
252
  }
252
253
  }
253
254
  async refresh() {
254
- console.log("Procs.refresh")
255
255
  let map = {}
256
256
  this.refreshing = true
257
257
  let ts = Date.now()
258
258
  let list = await new Promise((resolve, reject) => {
259
- console.time(">>>>>>>>GET PORTS " + ts)
260
- console.log("get ports")
259
+ // console.time(">>>>>>>>GET PORTS " + ts)
260
+ // console.log("get ports")
261
261
  this.getPortPidList((portPidList) => {
262
- console.log("done: get ports")
263
- console.log({ portPidList })
264
- console.timeEnd(">>>>>>>>GET PORTS " + ts)
265
- console.time(">>>>>>> GET PIDS " + ts)
262
+ // console.log("done: get ports")
263
+ // console.log({ portPidList })
264
+ // console.timeEnd(">>>>>>>>GET PORTS " + ts)
265
+ // console.time(">>>>>>> GET PIDS " + ts)
266
266
  // if there's any new port, run getPidToNameMap
267
267
 
268
268
 
269
- console.log("getPid")
269
+ // console.log("getPid")
270
270
  this.getPidToNameMap(portPidList, (pidToName) => {
271
- console.log("done getPid")
271
+ // console.log("done getPid")
272
272
 
273
- console.timeEnd(">>>>>>> GET PIDS " + ts)
273
+ // console.timeEnd(">>>>>>> GET PIDS " + ts)
274
274
  let list = portPidList.map(({ port, pid, ip }) => {
275
275
  const fullname = pidToName[pid] || 'Unknown';
276
276
  const name = fullname.split(path.sep).pop()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.15.21",
3
+ "version": "3.15.22",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {