pinokiod 3.2.239 → 3.2.245

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 CHANGED
@@ -491,37 +491,43 @@ class Kernel {
491
491
  })
492
492
 
493
493
  // get env
494
- let interval = setInterval(async () => {
495
- if (this.i) {
496
- for(let api of this.i.api) {
497
- let env_path = path.resolve(this.api.userdir, api.path)
498
- let e = await Environment.get(env_path)
499
- console.log(e)
500
- if (e.PINOKIO_SCRIPT_AUTOLAUNCH && e.PINOKIO_SCRIPT_AUTOLAUNCH.trim().length > 0) {
501
- let autolaunch_path = path.resolve(env_path, e.PINOKIO_SCRIPT_AUTOLAUNCH)
502
- let exists = await this.exists(autolaunch_path)
503
- console.log("ATTEMPTING AUTOLAUNCH", autolaunch_path)
504
- if (exists) {
505
- console.log("SCRIPT EXISTS. Starting...", autolaunch_path)
506
- let res = await new Promise((resolve, reject) => {
507
- this.api.process({
508
- uri: autolaunch_path,
509
- input: {}
510
- // client: req.client,
511
- // caller: req.parent.path,
512
- }, (r) => {
513
- resolve(r.input)
494
+ if (!this.launch_complete) {
495
+ let interval = setInterval(async () => {
496
+ if (this.i) {
497
+ for(let api of this.i.api) {
498
+ let env_path = path.resolve(this.api.userdir, api.path)
499
+ let e = await Environment.get(env_path)
500
+ console.log(e)
501
+ if (e.PINOKIO_SCRIPT_AUTOLAUNCH && e.PINOKIO_SCRIPT_AUTOLAUNCH.trim().length > 0) {
502
+ let autolaunch_path = path.resolve(env_path, e.PINOKIO_SCRIPT_AUTOLAUNCH)
503
+ let exists = await this.exists(autolaunch_path)
504
+ console.log("ATTEMPTING AUTOLAUNCH", autolaunch_path)
505
+ if (exists) {
506
+ console.log("SCRIPT EXISTS. Starting...", autolaunch_path)
507
+ let res = await new Promise((resolve, reject) => {
508
+ this.api.process({
509
+ uri: autolaunch_path,
510
+ input: {}
511
+ // client: req.client,
512
+ // caller: req.parent.path,
513
+ }, (r) => {
514
+ console.log({ autolaunch_path, r })
515
+ // resolve(r.input)
516
+ })
517
+ resolve()
514
518
  })
515
- })
516
- } else {
517
- console.log("SCRIPT DOES NOT EXIST. Ignoring.", autolaunch_path)
519
+ } else {
520
+ console.log("SCRIPT DOES NOT EXIST. Ignoring.", autolaunch_path)
521
+ }
518
522
  }
519
523
  }
524
+ console.log("clear Interval")
525
+ clearInterval(interval)
526
+ this.launch_complete = true
527
+ console.log("SETTING launch complete", this.launch_complete)
520
528
  }
521
- clearInterval(interval)
522
- this.launch_complete = true
523
- }
524
- }, 1000)
529
+ }, 1000)
530
+ }
525
531
  }
526
532
  // console.log({ grant_permission })
527
533
  // if (grant_permission) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.239",
3
+ "version": "3.2.245",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -3079,11 +3079,10 @@ class Server {
3079
3079
  res.json({ success: true })
3080
3080
  }))
3081
3081
  this.app.get("/pinokio/info", ex(async (req, res) => {
3082
- console.time("getInfo")
3083
3082
  await this.kernel.getInfo()
3084
- console.timeEnd("getInfo")
3085
3083
  let info = Object.assign({}, this.kernel.i)
3086
3084
  info.launch_complete = this.kernel.launch_complete
3085
+ console.log("kernel.launch_complete", this.kernel.launch_complete)
3087
3086
  delete info.vars
3088
3087
  delete info.shell_env
3089
3088
  delete info.memory