pinokiod 1.2.19 → 1.2.21
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/api/index.js +37 -5
- package/kernel/index.js +1 -1
- package/package.json +1 -1
package/kernel/api/index.js
CHANGED
|
@@ -527,6 +527,7 @@ class Api {
|
|
|
527
527
|
// replace {{{ }}} with {{ }}
|
|
528
528
|
rpc = this.kernel.template.flatten(rpc)
|
|
529
529
|
|
|
530
|
+
|
|
530
531
|
// 6. rpc must have method names
|
|
531
532
|
if (rpc.method) {
|
|
532
533
|
|
|
@@ -723,8 +724,42 @@ class Api {
|
|
|
723
724
|
|
|
724
725
|
} else {
|
|
725
726
|
// still going
|
|
726
|
-
let next_rpc = script.run[rpc.next]
|
|
727
|
-
|
|
727
|
+
//let next_rpc = script.run[rpc.next]
|
|
728
|
+
for(let i=rpc.next; i<script.run.length; i++) {
|
|
729
|
+
let next_rpc = script.run[i]
|
|
730
|
+
console.log("NEXT RPC", next_rpc)
|
|
731
|
+
if (next_rpc) {
|
|
732
|
+
return { request, rawrpc: next_rpc, input: result, step: i, total: script.run.length }
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// if all the steps are null, end.
|
|
737
|
+
if (script.daemon) {
|
|
738
|
+
this.ondata({
|
|
739
|
+
id: request.path,
|
|
740
|
+
type: "start",
|
|
741
|
+
data: {
|
|
742
|
+
title: "Started",
|
|
743
|
+
description: "All scripts finished running. Running in daemon mode..."
|
|
744
|
+
}
|
|
745
|
+
})
|
|
746
|
+
} else {
|
|
747
|
+
// no next rpc to execute. Finish
|
|
748
|
+
this.kernel.memory.local[request.path] = {}
|
|
749
|
+
this.ondata({
|
|
750
|
+
id: request.path,
|
|
751
|
+
type: "event",
|
|
752
|
+
data: "stop",
|
|
753
|
+
rpc,
|
|
754
|
+
rawrpc
|
|
755
|
+
})
|
|
756
|
+
await this.stop({
|
|
757
|
+
params: {
|
|
758
|
+
uri: request.path
|
|
759
|
+
}
|
|
760
|
+
})
|
|
761
|
+
}
|
|
762
|
+
//return { request, rawrpc: next_rpc, input: result, step: rpc.next, total: script.run.length }
|
|
728
763
|
}
|
|
729
764
|
|
|
730
765
|
} catch (e) {
|
|
@@ -809,9 +844,6 @@ class Api {
|
|
|
809
844
|
let concurrency = (rawrpc.queue ? 1 : 10);
|
|
810
845
|
|
|
811
846
|
// queue_id
|
|
812
|
-
if (rawrpc.queue) {
|
|
813
|
-
} else {
|
|
814
|
-
}
|
|
815
847
|
|
|
816
848
|
let queue_id
|
|
817
849
|
if (rawrpc.uri) {
|
package/kernel/index.js
CHANGED